Commit graph

15 commits

Author SHA1 Message Date
Kin Blas
19c06952fd Changes to allow 3rd party transitions. Developers can now register a custom transition by adding their transition handler to the $.mobile.transitionHandlers dictionary. The name of the custom transition is used as the key within the transtionsHandlers dictionary, and should be the same name used within the @data-transtion attribute.
The expected prototype for a transitionHandler is as follows:

function handler(name, reverse, $to, $from)

The name parameter is the name of the transition as specified by @data-transition attribute, reverse is a boolean that is false for a normal transition, and true for a reverse transition. The $to param is a jQuery collection containing the page that is being transitioned "to", and $from is an optional collection that tells us what page we are transitioning "from". Because $from is optional, handler developers should take care and check $from to make sure it is not undefined before attempting to dereference it.

In addition to registering custom transition by name, developers can specify a handler to use in the case where a transition name is specified and does not exist within the $.mobile.transitionHanlders dictionary. Within jQuery Mobile, the default handler for unknown transition types is the $.mobile.css3Transition() handler. This handler always assumes that the transition name is to be used as a CSS class to be placed on the $to and $from elements. To change the default handler, simply set $.mobile.defaultTransitionHandler to you function handler:

$.mobile.defaultTransitionHandler = myTransitionHandler;

The changes to make all this necessary are as follows:

- Created $.mobile.noneTransitionHandler which is the default transitionHandler for the framework that simply adds and removes the page active class on the $from and $to pages with no animations.

- Moved class based transition code into a new plugin jquery.mobile.transition.js file. This plugin, when present, overrides the noneTransitionHandler as the defaultTranstionHandler for the framework so that CSS3 animation transitions are available.

- Removed code related to the setting/removal of the ui-mobile-viewport-perspective class. The css3TransitionHandler plugin takes care of automatically placing a "viewport-<transition name>" class on the viewport (body) element. This allows any other transition to specify properties on the viewport that are necessary to accomplish the transition.

- changed the CSS class ui-mobile-viewport-perspective to viewport-flip to match code changes. This makes it more apparent that setting -webkit-perspective is only used with the flip transition.

- Updated js/index.php, Makefile and build.xml to include the new jquery.mobile.transition.js file.
2011-04-26 14:06:10 -07:00
Jesse Streb
34260225a7 Removing height: 120% as it appears to have caused unnecessary flickering and by setting the min-height of each page creation is unnecessary. 2011-01-31 21:42:38 -05:00
Jesse Streb
378fb51225 [#455] For the transitions we now have overflow: hidden in order to limit the flickering. We always scroll to the top before we start our transitions in order to make it scroll. The CSS changed to have overflow: hidden during transitions and have a height that is larger enough to keep the address bar hidden. 2011-01-27 12:28:04 -05:00
scottjehl
4b53be8f45 removed hidden overflow rule, which makes page transitions a little cleaner on the desktop, but more importantly, Fixes #446, Fixes #678 2011-01-13 18:08:59 -05:00
John Bender
95ef08b269 perspective class only added on flip page transition or any transition added to the perspectiveTransitions local var in the transitionPages function Fixes #568 2010-12-13 02:21:40 -08:00
Kin Blas
3062199ac6 Some tweaks to kptdobe's patch from:
https://github.com/jquery/jquery-mobile/pull/649

  - Changed hideOnTouchEnabed to touchToggleEnabled.
  - Fixed problem that would allow the toolbars to show on touchstop, if the starting state was "inline" to begin with.
  - Moved the touchToggleEnabled checks in touchstart/touchstop so that they wrap the entire code in the function. We don't want to do any work if we don't need to.
  - Removed the forced hide() call in touchstart.

Added the missing fadeout animation reference inthe fade.in transition rule.
2010-12-10 10:17:16 -08:00
Kin Blas
6656d1f84c Fixed 373 - Re-visit the need for -webkit-backface-visibility property on ui-page
- Removed -webkit-backface-visibility from all general rules and placed it in the .slide transition rule. It was impacting scroll performance and causing some rendering problems on iOS 3.1.x and some Android platforms.
2010-11-03 23:30:44 -07:00
scottjehl
f66047f410 added class 'ui-mobile-viewport-transitioning' to page parent container during transitions, and applied css to give perspective and proper dimension to the container and child pages. Also set overflow to hidden.
Fixes #347
2010-11-02 16:29:12 -04:00
scottjehl
edc1b81ba4 added ui-mobile-viewport class to parent of page element ( body in most cases). Updated css to style this class instead of body 2010-11-02 16:00:23 -04:00
Kin Blas
d96ef2ea7d Fixed 138 - transition: fix flip (and cube?)
- Added a -webkit-perspective property to the body element, since it is the container for the element (ui-page) that actually flips. We need specify this so a projection matrix gets created, giving the viewer some perspective. The 1000 represents the depth in pixels (the distance from the viewer to the z-plane). According to the CSS3 spec 1000 is a moderate value. Lower values make the effect more extreme.
2010-10-29 13:23:04 -07:00
jblas@adobe.com
acbec71e29 Fixed #117
"Global: blinky page transitions"

According to the CSS Animations spec as soon as an animation completes, any properties that were animated revert back to their previous values. This means that the CSS rule that refers to the animation by name must also have the "To" property values specified.
2010-10-28 23:40:11 -07:00
scottjehl
9afffcf645 added flip back in. seems to be a little better now 2010-10-15 15:47:04 -04:00
scottjehl
abed550d67 removed some transitions for alpha 2010-10-15 15:02:00 -04:00
scottjehl
53b3d6828b added the other transitions from jQtouch. 2010-10-15 13:37:49 -04:00
scottjehl
d5cbcf755b Created a themes directory and moved all CSS and images there.
Edited the PHP combiner and .htaccess logic to accommodate this change, as well as allowing manifest files to use a "../" when referencing files, which will be handy when adding themes that don't include structural files yet.

Modified all HTML files to point to /themes/default for their theme.
2010-10-13 13:26:23 -04:00