Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Popup transition direction reverse #4903

Closed
wants to merge 1 commit into from

4 participants

Peter Murawski Jasper de Groot Sidhartha Grover Alexander Schmitz
Peter Murawski

Addresses issue #4743 - Popup transition direction reverse by adding support for
data-direction="reverse" on popup widget links.

Peter 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
Jasper de Groot

@chromepenguin - Thanks for your PR! See my comment here #4743

Sidhartha Grover

The slide transition can be used with reverse for left to right direction but when it transitions back it doesn't go from right to left. It should go from right to left on the way back. This especially noticeable for a popup. Can someone fix it please?

Jasper de Groot

@groovy21

Could you open a new issue for that and include a test page? See our Contributing Guidelines. Thanks!

Sidhartha Grover

Thank you for guiding me. Issue #5134 has been logged

Alexander Schmitz
Owner

there are conflicts here and this is old closing but will be happy to review if PR is updated

Alexander Schmitz arschmitz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 28, 2012
  1. popup.js: Added support for reverse transitions

    Peter authored
    Fixes #4743 - Popup transition direction reverse by adding support for
    data-direction="reverse" on popup widget links.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 js/widgets/popup.js
7 js/widgets/popup.js
View
@@ -44,6 +44,7 @@ define( [ "jquery",
shadow: true,
corners: true,
transition: "none",
+ direction: null,
positionTo: "origin",
tolerance: null,
initSelector: ":jqmData(role='popup')"
@@ -158,6 +159,7 @@ define( [ "jquery",
_ui: ui,
_fallbackTransition: "",
_currentTransition: false,
+ _isReversed: false,
_prereqs: null,
_isOpen: false,
_tolerance: null,
@@ -240,6 +242,7 @@ define( [ "jquery",
if ( value && value !== "none" ) {
this._fallbackTransition = $.mobile._maybeDegradeTransition( value );
this._ui.container.addClass( this._fallbackTransition );
+ if (this._isReversed) this._ui.container.toggleClass( "reverse" );
}
},
@@ -499,6 +502,7 @@ define( [ "jquery",
if ( transition ) {
this._currentTransition = transition;
+ if (options.direction === "reverse" ) this._isReversed = true;
this._applyTransition( transition );
} else {
transition = this.options.transition;
@@ -560,7 +564,7 @@ define( [ "jquery",
transition: ( this._currentTransition || this.options.transition ),
classToRemove: "in",
screenClassToAdd: "out",
- containerClassToAdd: "reverse out",
+ containerClassToAdd: this._isReversed ? "out" : "reverse out",
applyTransition: true,
prereqs: this._prereqs
});
@@ -741,6 +745,7 @@ define( [ "jquery",
x: offset.left + $link.outerWidth() / 2,
y: offset.top + $link.outerHeight() / 2,
transition: $link.jqmData( "transition" ),
+ direction: $link.jqmDate( "direction" ),
positionTo: $link.jqmData( "position-to" )
});
Something went wrong with that request. Please try again.