Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes #2529 - Transition to the same page

- So it seems just allowing changePage() to process same toPage and fromPage is not enough. I modified the CSS3 keyframe

animation plugin so that it only removes the ui-page-active class from the fromPage if it is *NOT* the same as the toPage.

- I also re-ordered the in/out transition rules for forward/reverse transitions so that the user always views some sort of animation/motion.
  • Loading branch information...
commit ca9df1197a9748ee7448fb9b28c14c41d80d4601 1 parent 2b2935b
@jblas jblas authored
View
2  js/jquery.mobile.transition.js
@@ -18,7 +18,7 @@ function css3TransitionHandler( name, reverse, $to, $from ) {
$to.add( $from ).removeClass( "out in reverse " + name );
- if ( $from ) {
+ if ( $from && $from[ 0 ] !== $to[ 0 ] ) {
$from.removeClass( $.mobile.activePageClass );
}
View
74 themes/default/jquery.mobile.transitions.css
@@ -23,19 +23,15 @@ Built by David Kaneda and maintained by Jonathan Stark.
-webkit-animation-duration: 350ms;
}
-.slide.in {
- -webkit-transform: translateX(0);
- -webkit-animation-name: slideinfromright;
-}
.slide.out {
-webkit-transform: translateX(-100%);
-webkit-animation-name: slideouttoleft;
}
-.slide.in.reverse {
+.slide.in {
-webkit-transform: translateX(0);
- -webkit-animation-name: slideinfromleft;
+ -webkit-animation-name: slideinfromright;
}
.slide.out.reverse {
@@ -43,15 +39,25 @@ Built by David Kaneda and maintained by Jonathan Stark.
-webkit-animation-name: slideouttoright;
}
+.slide.in.reverse {
+ -webkit-transform: translateX(0);
+ -webkit-animation-name: slideinfromleft;
+}
+
+.slideup.out {
+ -webkit-animation-name: dontmove;
+ z-index: 0;
+}
+
.slideup.in {
-webkit-transform: translateY(0);
-webkit-animation-name: slideinfrombottom;
z-index: 10;
}
-.slideup.out {
- -webkit-animation-name: dontmove;
+.slideup.in.reverse {
z-index: 0;
+ -webkit-animation-name: dontmove;
}
.slideup.out.reverse {
@@ -60,19 +66,20 @@ Built by David Kaneda and maintained by Jonathan Stark.
-webkit-animation-name: slideouttobottom;
}
-.slideup.in.reverse {
- z-index: 0;
+.slidedown.out {
-webkit-animation-name: dontmove;
+ z-index: 0;
}
+
.slidedown.in {
-webkit-transform: translateY(0);
-webkit-animation-name: slideinfromtop;
z-index: 10;
}
-.slidedown.out {
- -webkit-animation-name: dontmove;
+.slidedown.in.reverse {
z-index: 0;
+ -webkit-animation-name: dontmove;
}
.slidedown.out.reverse {
@@ -81,11 +88,6 @@ Built by David Kaneda and maintained by Jonathan Stark.
-webkit-animation-name: slideouttotop;
}
-.slidedown.in.reverse {
- z-index: 0;
- -webkit-animation-name: dontmove;
-}
-
@-webkit-keyframes slideinfromright {
from { -webkit-transform: translateX(100%); }
to { -webkit-transform: translateX(0); }
@@ -106,7 +108,6 @@ Built by David Kaneda and maintained by Jonathan Stark.
to { -webkit-transform: translateX(100%); }
}
-
@-webkit-keyframes slideinfromtop {
from { -webkit-transform: translateY(-100%); }
to { -webkit-transform: translateY(0); }
@@ -136,15 +137,16 @@ Built by David Kaneda and maintained by Jonathan Stark.
to { opacity: 0; }
}
+.fade.out {
+ z-index: 0;
+ -webkit-animation-name: fadeout;
+}
+
.fade.in {
opacity: 1;
z-index: 10;
-webkit-animation-name: fadein;
}
-.fade.out {
- z-index: 0;
- -webkit-animation-name: fadeout;
-}
/* The properties in this rule are only necessary for the 'flip' transition.
* We need specify the perspective to create a projection matrix. This will add
@@ -170,28 +172,28 @@ Built by David Kaneda and maintained by Jonathan Stark.
-webkit-transform:translateX(0); /* Needed to work around an iOS 3.1 bug that causes listview thumbs to disappear when -webkit-visibility:hidden is used. */
}
-.flip.in {
- -webkit-transform: rotateY(0) scale(1);
- -webkit-animation-name: flipinfromleft;
-}
-
.flip.out {
-webkit-transform: rotateY(-180deg) scale(.8);
-webkit-animation-name: flipouttoleft;
}
-/* Shake it all about */
-
-.flip.in.reverse {
+.flip.in {
-webkit-transform: rotateY(0) scale(1);
- -webkit-animation-name: flipinfromright;
+ -webkit-animation-name: flipinfromleft;
}
+/* Shake it all about */
+
.flip.out.reverse {
-webkit-transform: rotateY(180deg) scale(.8);
-webkit-animation-name: flipouttoright;
}
+.flip.in.reverse {
+ -webkit-transform: rotateY(0) scale(1);
+ -webkit-animation-name: flipinfromright;
+}
+
@-webkit-keyframes flipinfromright {
from { -webkit-transform: rotateY(-180deg) scale(.8); }
to { -webkit-transform: rotateY(0) scale(1); }
@@ -231,6 +233,11 @@ Built by David Kaneda and maintained by Jonathan Stark.
z-index: 10;
}
+.pop.in.reverse {
+ z-index: 0;
+ -webkit-animation-name: dontmove;
+}
+
.pop.out.reverse {
-webkit-transform: scale(.2);
opacity: 0;
@@ -238,11 +245,6 @@ Built by David Kaneda and maintained by Jonathan Stark.
z-index: 10;
}
-.pop.in.reverse {
- z-index: 0;
- -webkit-animation-name: dontmove;
-}
-
@-webkit-keyframes popin {
from {
-webkit-transform: scale(.2);
Please sign in to comment.
Something went wrong with that request. Please try again.