Commit graph

256 commits

Author SHA1 Message Date
scottjehl
d4f84f97b2 For discussion purposes, this is a very simple example of one way we could provide a filtering mechanism for data-based (JSON) server responses. The demo php page responds as html or json depending on whether it's requested via regular http or Ajax. 2011-08-19 18:04:59 -04:00
gseguin
9f3836e7b1 Fix for issue #1405: Moved assignment of $activeClickedLink to the vclick handler in charge of adding the active state 2011-08-17 17:32:55 -07:00
scottjehl
ee17b4f05c Ensure that navigating backwards through dialogs works as expected when domCache is false (which is the default now). 2011-07-31 10:03:22 -04:00
scottjehl
be74405b49 Added a configurable timeout to $.mobile.loadPage to give pages that are being fetched from cache a little time to load before a loading message appears. We'll need to tweak this timer based on device testing to determine how long it takes on average to fetch a cached page. If the delay ends up needing to be longer than 300ms or so to suit some devices, it's probably not worth having this feature at all. 2011-07-30 08:33:04 -04:00
scottjehl
bdba60efd5 removed urlHistory references to (and use of) each entry's "page" property, which kept a reference to the DOM elements of each page that had been loaded. This fixes leaking memory on removed pages, and outsources page requests to the browser cache (for real this time :) ). 2011-07-29 19:51:17 -04:00
John Bender
50acf2eb7c fix to use options defined on page widget to determing domCache settings 2011-07-29 12:55:40 -07:00
John Bender
27b4ba1691 ajaxDomCaching -> domCache 2011-07-29 10:10:26 -07:00
John Bender
d716f3e9e7 moved dom cache check above the enhance to let widgets unbind parent page hide behaviour. added parent removal to listview special remove 2011-07-29 10:10:25 -07:00
scottjehl
a8c3859d84 using regular data method to access widget 2011-07-29 10:10:25 -07:00
scottjehl
dc054a10e7 implemented ajax dom caching option of the page plugin, which can be overridden by page options or data attribute. Includes unit test to support feature. 2011-07-29 10:10:25 -07:00
Ghislain Seguin
d1e8083f15 Merge pull request #2152 from webmynd/master
Consider data-role when picking page transition in changePage
2011-07-27 10:04:39 -07:00
Samuel Padou
051855e94d Bug 2064; Add try/catch block to prevent 'Unspecified error' when we use an IFrame on IE9 2011-07-27 14:53:27 +02:00
James Brady
9cf3a60dee Consider data-role when picking page transition.
Re-use existing "isDialog" variable in changePage,
instead of just looking at settings.role.
2011-07-27 12:24:41 +01:00
scottjehl
1a828594f5 default for loadPage should be to not show the loading message, since its default use case is to fetch a page that is not yet active. However, changePage should cause it to show because loadPage is being called during a page change. 2011-07-21 08:04:12 -04:00
scottjehl
259815d480 Make data-role=page elements optional. This change makes the framework more lenient with markup, and will ease integration with existing sites, as well as mashups with external content. Unit tests included. Fixes #2096 2011-07-17 14:52:49 -04:00
scottjehl
f84ceb12ed Merge remote branch 'origin/master' 2011-07-15 16:30:03 -04:00
John Bender
ca173441d0 small refactor the the base url change for readability 2011-07-15 10:47:06 -07:00
scottjehl
a5d0a294e9 Implemented data-prefetch attribute for anchor elements. Presence of this attribute on an anchor will cause the referenced page to be preloaded when the parent page of that anchor is shown. Fixes #1819. 2011-07-15 13:16:31 -04:00
John Bender
d827be3bf2 relative url change per Kin Blas's last pre-vacation request 2011-07-13 16:04:24 -07:00
John Bender
b761496ece moved typeof check to jQuery.type() 2011-07-07 09:22:24 -07:00
John Bender
bf9c071900 whitespace in navigation 2011-07-07 09:19:16 -07:00
Ghislain Seguin
2deeee14d7 More elegant fix for #1990
Re-use $.mobile.allowCrossDomainPages & call deferred.reject to notify caller of failure
2011-06-30 13:40:06 -07:00
Ghislain Seguin
8117f12ad5 Coding standards 2011-06-29 21:03:12 -07:00
Ghislain Seguin
b02e19891a Replace $.noop by function that throws to not fail silently 2011-06-29 21:02:53 -07:00
Ghislain Seguin
5fe310600f Fix for #1990: Introducing $.mobile.ajaxCrossDomainEnabled defaults to false 2011-06-29 20:00:12 -07:00
Kin Blas
2b51355656 Switch back to processing link clicks on the "click" event. It really is the only reliable way across all the devices we support.
Also, remove all references to useFastClick.
2011-06-29 17:38:00 -07:00
Kin Blas
aff87cc9f1 Fix for the mysterious "page is too large" error Todd and Scott were seeing on Blackberry 5 prior to shipping jQM beta 1.
Turns out this little code was enough to invoke the error:

"/dir1/dir2".replace(/\/?/, "");

Rewrote the regexp in path.makePathAbsolute() that was stripping leading slash, and trailing filename/slash. This gets around the problem.

Special thanks to @adambiggs for helping me test 33 iterations when trying to narrow down what in jquery.mobile.navigation.js was choking BB5.
2011-06-27 16:50:01 -07:00
Kin Blas
0d65a0d1c5 - Fixed issue #1923 - url of form is miscalculated
- Added code to calculate whether to choose the documentUrl or the page Url in the case where an action is not specified on a form element.

	- Fixed bug in the navigation "submit" handler where an error was being thrown if "type" was not specified.

	- Fixed typo "diabled" id typos in tests/unit/navigation/index.html.

	- Added tests for form submissions with no action in both base and non-base specified cases.
2011-06-27 10:25:13 -07:00
Martin Sutherland
83973b429b Fix issue 1913 - unnecessary ajax call and duplicate DOM nodes when refreshing a page with a dialog visible 2011-06-23 18:33:06 +02:00
scottjehl
a43ce64db2 moved our form binding into the _registerInternalEvents callback, to ensure it's not bound until after mobilinit. 2011-06-22 11:43:22 -04:00
scottjehl
c227535bd7 removed vclick + click combined event binding, which was in there as a workaround for a not-consistently-occurring bug in Android 2.1. I think the real issue is related to lack of dynamic base tag support, and that occasionally, a relative href click will use default handling in 2.1 and go where it shouldn't (ignoring the base href). Either way, this double binding causes history problems in Safari, so I'm removing it while we search for a better 2.1 workaround. Fixes #1870 2011-06-21 12:43:17 -04:00
scottjehl
ffdfa4e7c2 moved page load event bindings to a post-mobileinit callback so that the useFastClick option can be set before it is used. Unit test included. Fixes #1869 2011-06-21 11:33:38 -04:00
Kin Blas
5890a801be Fixed a couple of errors caught by jshint. 2011-06-20 15:09:54 -07:00
scottjehl
9fffcb6eca bind to click as well, for an edge case in android 2.1 2011-06-20 13:44:33 -04:00
scottjehl
9c9a9ad147 set page min-height using availHeight or availWidth, rather than height (to fine tune height to exclude browser chrome). Also, reset the active page height on throttledresize and pageshow, eliminating some duplicate calls. 2011-06-20 13:31:26 -04:00
scottjehl
45a71ac499 Added global config option "useFastClick", so that the changes we made for automated ajax handling since A4 can be disabled if needed, for whatever reason. When handling clicks and taps automatically with Ajax, this option will use jQuery Mobile's <code>vclick</code> event, enabling page changes to happen slightly sooner on devices that support touch events, and keeping the address bar hidden during page transtions. When disabled, the automatied Ajax handling will use an ordinary <code>click</code> event instead. This option has no effect on non-touch devices, but when enabled, it may interfere with jQuery plugins that bind to click events rather than vclick events. Fixes #1857 2011-06-20 11:35:09 -04:00
scottjehl
823485ce11 Blur other buttons when a new one is clicked and gaining focus. This gets rid of the trail of focus states issue we've been seeing. Fixes #1840. 2011-06-19 14:34:36 -04:00
scottjehl
a09c53eb71 improved the address bar hiding logic to support Android as well by determining up-front which hiding number should be used. Fixes #1673. Fixes #1322. Fixes #1786. 2011-06-19 13:53:27 -04:00
scottjehl
ffa35c0548 improved minheight page logic 2011-06-17 19:19:47 -04:00
scottjehl
fcbfc2f380 added minScrollBack feature to core options. This is the minimum scroll distance that will be jumped-to when returning to a page. By default, the distance is screen.height /2. If you really needed to disable scroll memory altogether, this could be set to Infinity. Note that disabling scroll memory altogether is almost never a good idea for usability, but the option is there. 2011-06-17 19:19:47 -04:00
scottjehl
3bd713c185 added resetActivePage on pagecreate, orientationchange, and after transitions. 2011-06-17 19:19:47 -04:00
scottjehl
690dc66f7c set heights including respective scrolls 2011-06-17 19:19:46 -04:00
scottjehl
aa950ba125 Only call scrollTo if there's a scroll distance we need to go to. If the distance we're jumping to is 20px or less, let it go in for tolerance. Reset toPage height before scrolling, focusing. 2011-06-17 19:19:46 -04:00
scottjehl
df7ac2f642 fix up the page heights during transitions, and min-heights otherwise. 2011-06-17 19:19:46 -04:00
scottjehl
ed7aae1d1c hide address bar during page changes by catching ajax clicks early through binding to touchend, and make pages fit screen height during transitions 2011-06-17 19:19:46 -04:00
scottjehl
722ed2cbbf If ajax is disabled, exit the click handler early and avoid parsing the href at all. Thanks for the idea, @toddparker! Fixes #1846. 2011-06-17 18:33:16 -04:00
Kin Blas
96b3e710d4 Added utility functions $.mobile.getDocumentBase() and $.mobile.getDocumentUrl() so that developers can retrieve the original base and url used when loading the document. 2011-06-16 15:43:40 -07:00
Kin Blas
8b6d14bb03 Fix for issue 1826 - Nightly build - dialog box no longer rounded corners
- Don't set a default value for the 'role' option to loadPage() and changePage(). Instead, rely on the role attribute that is on the element.

- Fixed an error that was happening when a hash change involves going from a dialog back to another dialog. I had recently made changes that assumed the 'to' variable was always going to be a url string, but it turns out in the dialog back to dialog case, it is an actual jQuery collection.
2011-06-16 13:36:39 -07:00
Kin Blas
d2f115349a Fix for issue 1833 - No page transition used when hitting the browser forward button
- Don't use the transition of the initial page on the stack.
2011-06-15 15:28:52 -07:00
jblas@adobe.com
dd69372dd4 Adjusted the urlParserRE regexp to account for double slashes in the directory path to work around a phonegap 0.9.4. 2011-06-15 10:37:08 -07:00