Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine default changeView behavior based on source order #10

Open
tylersticka opened this issue Apr 22, 2014 · 4 comments
Open

Determine default changeView behavior based on source order #10

tylersticka opened this issue Apr 22, 2014 · 4 comments
Milestone

Comments

@tylersticka
Copy link
Member

Currently, the changeView method requires a value for the action argument of either "push" or "pop".

It would be nice if the source order of the views could determine the action to take in cases where that value is not provided. This could be accomplished by comparing the value of @$views.index(@$activeView) with the value of @$views.index($targetView).

This could also allow us to add a new data-attribute, data-changeview, which could do either a push or pop depending on the source order.

@lyzadanger
Copy link

@tylersticka I want to be sure I understand: assuming something like a data-changeview attr, when triggered (click by default), is it that the view indicated (as either the value of the attr or in the href attr) should be pushed if it's later in the DOM and popped if it's earlier? Trying to get my head around this!

@tylersticka
Copy link
Member Author

@lyzadanger What you just described is exactly correct. :)

@tylersticka
Copy link
Member Author

@lyzadanger Also, if you'd like, we could use the major version change to change up that syntax.

One thing I've wondered is if it makes more sense to have a separate data-changeview-direction, or to change up the syntax entirely so it's data-slideview-direction: "push" and always either the href or a data-slideview attribute?

(Typed hurriedly, sorry if it is incoherent.)

@lyzadanger
Copy link

This is complete on the v2.0.0 branch.

@lyzadanger lyzadanger added this to the v2.0.0 milestone Apr 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants