Commit graph

228 commits

Author SHA1 Message Date
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
Kin Blas
c011f51f14 Removed unused path.isRelative() function. Replaced unit tests for isRelative() with tests for path.isRelativeUrl. 2011-06-13 16:45:10 -07:00
Kin Blas
e286808391 Rule of thumb ... get your logic right and your code will behave as you expect.
- I should've been using !== instead === when figuring out docBaseDiffers.
2011-06-10 16:13:58 -07:00
Kin Blas
963a84cb18 IE7 returns an empty string for regexp submatches while all other browsers return undefined. Modified the parseUrl() function to normalize all non-matches to an empty string and replaced all strict checks for undefined to strict checks for an empty string. 2011-06-10 15:31:09 -07:00
Kin Blas
244385b9f9 Merge branch 'master' into path-fixes 2011-06-10 10:02:11 -07:00
Kin Blas
b7bcf93620 - We were missing a changepage notification in the case where we were transitioning to the same page.
- Added changepagefailed notification for the case where the load fails. Note we still need beforeloadpage/loadpage notifications.

- Misc fixes to stop the navigation unit tests from seemingly random failures. It seems that the hash resets in setup/teardown of the test modules sometimes interferes with the changePage() requests in the tests. Added code to the setup/teardown functions to wait for the reset to complete before moving on to the tests.
2011-06-10 10:00:25 -07:00
frietsch
d99d096ab7 Bugfix: ":jqmData(ajax='false')" might also match forms, which have neither of "src" or "href". In that case, thisUrl is undefined, and the following replace results in an error. 2011-06-09 08:21:21 -07:00
Kin Blas
3d6bd402a2 - Changes to get the navigation_helpers.js unit tests green.
- Modified isExternal so that it returns true/false to help with unit tests.
2011-06-08 17:20:01 -07:00
Kin Blas
8e1e77badf Get deep linking to internal pages working again. We can now also deep link to nested list sub-pages that are contained within internal pages. 2011-06-08 15:06:41 -07:00
Kin Blas
33b9ee8052 Changes to make sure the data-url are either an id, site relative path (for same domain), or absolute Url (for cross-domain Phone Gap). 2011-06-08 14:47:24 -07:00
Kin Blas
a99728d178 - Added addSearchParams() utility function.
- Removed unused path functions: setOrigin(), makeAbsolute(), and isQuery().
- Modified loadPage() so that it uses addSearchParams() instead of naively appending it to the URL.
- Switched the global "click" handler back to using the link @href attribute and manually converting it to an absolute URL. This was necessary because it turns out that the href property on a link is dynamically calculated at the time of access based on the *CURRENT* base tag setting. This means the same link can return a different href value if the the base tag is different each time you access it.
2011-06-06 15:58:21 -07:00
Kin Blas
19f1a775b9 Missed a couple of places I should've used hrefNoHash when I converted documentBase to an urlObject. 2011-06-04 10:51:41 -07:00
Kin Blas
f9dd767528 Switched form handler over to processing absolute urls. 2011-06-04 01:22:16 -07:00
Kin Blas
ba502f0aff Changes to switch the global link click handler over to processing absolute urls. 2011-06-04 00:26:25 -07:00
Kin Blas
b148ee424a Added isSameDomain() Utility function. 2011-06-03 13:57:25 -07:00
Kin Blas
b31825a1d7 Fixed issue 1767 - loadPage/changePage broken in trunk (latest build)
- Not sure how/why I added that extra absUrl, but its gone now.
2011-06-02 10:41:55 -07:00
Kin Blas
a2182dafa9 - Added a getClosestBaseUrl() utility function for calculating the correct base URL to use for a given element.
- We should be using makeUrlAbsolute() instead of makePathAbsolute() when calculating the documentBase.
- Removed bogus code in pathname calculatino in makeUrlAbsolute().
- Reworked calculation of search in makeUrlAbsolute() to prevent an undefined in the case where rel and abs urls have no search.
2011-06-01 17:15:18 -07:00
Kin Blas
3ca5dd854a - Added URL parsing and relative to absolute path and url utility methods.
- Switched the base tag management code over to using new utilities.
2011-06-01 11:59:13 -07:00
Kin Blas
ef9d55f4b6 Hopefully the last set of fixes for issue 1712 - $.mobile.changePage broken in latest
- The test case calls changePage() with a hash ("#b"). In our normal processing of clicks/form submits we strip it before calling. The old code did a strip in changePage() just in case, so I added it back in to fix the last bug.
2011-05-27 10:53:19 -07:00
Kin Blas
6fdb90df17 Fixed a typo in $.mobile.loadPage.defaults. The default for the data property should be undefined, not the string "undefined". 2011-05-26 17:04:27 -07:00
Kin Blas
7befe9087a The signature of changePage() has changed but folks need some time to transition to using the new signature. I added code to changePage() that maps any old signature calls to changePage() into a new call. This should fix issue 1712 ($.mobile.changePage broken in latest). This code should be removed before shipping 1.0. 2011-05-26 16:39:09 -07:00
Kin Blas
bee8549a18 Fixed a bad typo caught by @johnbender and @gseguin.
- Replaced an un-intentional semi-colon with a comma.
2011-05-25 15:13:44 -07:00
scottjehl
8929ac33b9 Removed the ajaxLinksEnabled and ajaxFormsEnabled settings. These were deprecated in a4 and scheduled for removal. Automated link and form ajax handling can still be globally disabled via the ajaxEnabled option. 2011-05-24 16:08:30 -04:00
Kin Blas
786ef25e0a Changes to get the navigation unit tests green again.
- Modified changePage() to set isPageTransitioning earlier.
- Modified pageSequence() to allow the current changepage callback stack to unwind before firing off the next function in the sequence.
2011-05-23 14:30:40 -07:00
John Bender
dc530ea751 page sequence helper added, nav tests in a somewhat better state. the event trigger spot, namespace, and general setup are all up for debate 2011-05-21 22:15:12 -07:00
Kin Blas
5ba2cc975e Inverted the logic around ignoreNextHashChange so that it actually matches the name of the variable.
Modified the hashchange callback so that it specifies a "none" transition, instead of a false boolean, for the case where the hash changed and there is nothing on the urlHistory stack.
2011-05-20 15:19:54 -07:00
Kin Blas
edc94fb6ec The dialog "pop" unit test was failing because the active variable in changePage() was being dereferenced. The unit test clears the urlHistory.stack array manually so we just need to make sure we don't dereference active if it doesn't exist. 2011-05-19 17:01:26 -07:00
Kin Blas
59afbda49b Added a pageContainer option to changePage and loadPage. 2011-05-18 18:06:15 -07:00
Kin Blas
3a047112a0 Removed debug try/catch block I accidentally checked in.
Made lots of whitespace changes to bring file up to jquery core style guidelines.
2011-05-18 16:38:04 -07:00