Skip to content

Popup: transition direction reverse #4743

Closed
jaspermdegroot opened this Issue Jul 25, 2012 · 8 comments

3 participants

@jaspermdegroot
jQuery Foundation member

Make it possible to set option direction "reverse" for the transition.

@gabrielschulhof

Some transitions cannot be used in reverse. For example, fade and pop would leave the popup in an unusable final state if they were applied in reverse. flip could probably be reversed. slide has variants slideup, slidedown, and, AFAIK slideout to deal with reverse directions.

In summary, I don't believe this necessitates code changes to popup.

@jaspermdegroot
jQuery Foundation member

I will add a note to the docs that direction="reverse" can not be used for popup transitions (only pages/dialogs).

@jaspermdegroot
jQuery Foundation member

Fixed by commit 3941c00

@chromepenguin

There are several transitions that require data-direction="reverse" in order to use them from the other direction: slide, flow, slidefade, and pop (which does not leave it in an unusable state) all support being played in reverse and are incomplete without this ability.

The main issue is that there is no "slideout" transition, so this issue prevents popups from being able to slide in from left to right.

This is important functionality and there's no good reason it should be absent.

@chromepenguin chromepenguin added a commit to chromepenguin/jquery-mobile that referenced this issue Aug 28, 2012
@chromepenguin chromepenguin popup.js: Added support for reverse transitions
Fixes #4743 - Popup transition direction reverse by adding support for
data-direction="reverse" on popup widget links.
d62e1a8
@jaspermdegroot
jQuery Foundation member

@chromepenguin

I agree that it should be possible to have a left to right slide transition. That was the reason I opened this issue.
Because the reverse transition is used for closing the popup, supporting the option data-direction="reverse" is probably not the right solution. I suggest we add a "slideout" transition.

@toddparker - What's your opinion on this?

@chromepenguin

In my PR I handle the transition used for closing the popup by only adding the "reverse" class if the initial transition was not reversed. This is perhaps a little counter-intuitive but the user never sees it. If data-direction is only meant to specify the direction of the transition, then I think this would be acceptable as it also allows other transition sets (namely flow and slidefade) to be used in reverse with no additional work.

However, if data-direction is meant to specify the direction of navigation then I agree that it would not make much sense in this case. If you think it would be cleaner in the long run to add aliases to reversible transition sets then I would accept this as well, provided reverse aliases are also available for flow and slidefade.

@jaspermdegroot
jQuery Foundation member

@chromepenguin

I should have looked better at your PR. I missed the part that the reverse direction is only used for closing the popup if it hasn't been used already to open it. Going to discuss this with the team.

@jaspermdegroot
jQuery Foundation member

Removing feature request label and milestone. Using ticket #5134 for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.