If data-url is set on a page div when it returns from the server, it's value will be used to replace the url in the hash, and as the base url for future requests if it adds additional segments (such as a trailing slash). This will enable developers to work around the limitation of directory links requiring a trailing slash, and will also allow developers to specify a new url after a redirect occurs (such as after a login). Fixes#867
- Modified silentScroll() to trigger a "silentscroll" event. This was necessary because programatically scrolling the window does not generate "scroll" events.
- Got rid of the hideAfterDelay() function that was not used.
- Added startShowTimer() and clearShowTimer() functions.
- Added event handlers for "resize" and "silentscroll" events. This causes headers/footers to be positioned properly as "scroll" and "orientationchange" events cause the visual viewport to resize.
Issues this fix causes:
- On some Android platforms, clicking in textfields/textareas trigger a "resize" event. This causes the footer to show up in the minimized visual viewport, right above the keyboard.
In the process, some other small changes should be noted:
urlStack is now urlHistory, a hash of methods and properties used for history stack management (stack, activeIndex, getActive, getPrev, getNext, addNew, clearForward, and listening Enabled). All these are documented inline and exposed on $.mobile.urlHistory (I'm not sure these will be publicly documented, but just exposed internally for plugins for now).
$.changePage has two argument changes: the "back" argument is now called "reverse"; this results in no change from an end-user standpoint, but reflects the fact that it only reverses the direction of a transition without affecting the internal history stack, and second, a new argument at the end defines whether changePage was called from a hashChange which makes that url open to history menu guessing.
This makes our include model match the include model on the CDN, and allows devs to make use of mobileinit for debugging some of the samples since that must be set up after jquery.js, but before jquery-mobile.
- Fixed baseTagTest() in jquery.mobile.support.js, so that it uses any pre-existing base tag for testing. This fixes the bug on Webkit (Safari) where the relative paths for links were being resolved/expressed with the document path instead of the original base path.
- Modified the base code in jquery.mobile.navigation.js so that it uses the initial path of a pre-existing base tag, instead of always using the document path. This means that a document with a URL such as:
http://foo.com/a/b/c#docs/pages/index.html
That uses a base tag like:
<base href="http://foo.com/bar/">
Will resolve properly:
http://foo.com/bar/docs/pages/index.html
so the mobile page gets loaded properly.
- Reduced the path.get() function down to a couple of regexp replace() calls.
- We were firing off our fake orientationchange event before the viewport meta tag is injected. This causes us to get the default document width for the device which is much wider than the actual device-width. We now fire off the event after the dom ready event fires.