Commit graph

184 commits

Author SHA1 Message Date
Todd Parker
084bbbd839 Merge pull request #1573 from marcoos/master
fix for issue 1530: Page title is changing when I use popup select menu (Dropdown). Thanks marcoos.
2011-05-09 13:03:02 -07:00
Kin Blas
e597ccb381 Fix for issue 1580 - phonegap: Pages with data-ajax="false" on form fail to load
In the $.ajax() callback, we look for elements with @href, @src, and @data-ajax="false" elements, the code then assumes that matching elements will have either @href or @src, which of course forms don't ... they have @action ... so the code throws an exception because thisUrl is undefined.

- I reworked the code to handle action and check to make sure we have an attribute and url string before attempting to use them.
2011-05-06 13:05:56 -07:00
Kin Blas
e775f5e83a Fix for Issue 1578 - Can't load file:// pages
This was caused by this checkin:

4b4ee54a72

The change caused the base tag to be reset to file:// (literally with no path).

All that was missing was a small tweak to base.reset() to use the new initialPath variable instead of docBase.
2011-05-06 10:28:31 -07:00
scottjehl
4b4ee54a72 This change sets the base tag properly on page load and page changes, corresponding with the recent change to absolute path hash urls. Images and other assets will direct relative to the document in which they reside. This may not cover new path situations Kin has documented, but it does fix the regression so things work as they did before the change. Tested in non-base supporting browsers to verify it works there too. The following page should have an image in the content, verifying the fix http://jquerymobile.com/test/#/test/docs/about/intro.html . Fixes #1508 2011-05-06 09:37:41 -04:00
Marek Stepien
50ee33a84f fix for issue 1530: Page title is changing when I use popup select menu ( Dropdown) 2011-05-05 23:26:41 +02:00
Paul Nicholls
91126e4e85 Issue #1514 (Regex breaking Firefox >3.6)
Remove greedy matches from start and end of regex - there's no need for them, and they cause immense slowdown (on the order of 3-4 seconds on medium-size pages loaded via ajax).
2011-05-03 10:48:06 +12:00
Steven Black
520b8e22d4 More formatting changes to meet JQuery Core Style Guidelines.
)) -> ) )
...and others.

Signed-off-by: Steven Black <steveb@stevenblack.com>
2011-04-29 08:22:03 -04:00
Steven Black
7447ba01f7 jquery.mobile.navigation.js: Changes throughout the file for jQuery coding standards including:
* whitespace within parenthesis
* double quotes
* line breaking for object key assignments
Also made several changes suggested by jsHint.
All tests pass as before -- still failing first three tests as before.

Signed-off-by: Steven Black <steveb@stevenblack.com>
2011-04-28 21:12:01 -04:00
Kin Blas
52a666d71f Check $from before dereferencing it. 2011-04-26 16:36:31 -07:00
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
Kin Blas
f7749504b8 Modified the vclick handler code in navgation.js so that it doesn't place the ui-btn-active class on any links meant for interactivity.
Removed the return false in the vclick handler of collapsible and replaced it with a preventDefault(). The only reason we were returning false was to stopPropagation() so that the vclick handler in navigation.js  didn't place a ui-btn-active on it.
2011-04-22 10:53:24 -07:00
Kin Blas
2d2e6d7741 Fix for issue 1461 - Tops of pages missing after dialog click in Safari and iPhone.
- Delayed the setting of focus till *AFTER* the scroll position is restored.
2011-04-21 15:31:21 -07:00
John Bender
dbd68472b4 whitespace and comment fixes 2011-04-18 22:35:13 -07:00
John Bender
8e42b52767 beginning to move to absolute hashes in all cases, still some more work to do 2011-04-18 21:46:53 -07:00
Kin Blas
c31ee33a0f Fix for 1407 - Bad scroll performance since A4 on iPhone 3G
- Modified vmouse code so that it uses $.data() instead of $().data() which is significantly faster.

- Modified the navigation and buttonMarkup code so they stop using live(). The vmouse code triggers several events during the touch events, which in turn causes the underlying event code to call $.closest() with the selector used during the live() call to figure out if the event should be handled. This turns out to be very expensive, so instead, we now just bind directly to the document, and walk the DOM manually to figure out if we should handle it. This is much faster since we are avoid triggering multiple nested function calls.
2011-04-18 16:13:50 -07:00
scottjehl
472cbb1778 moved calls into one. #cleaning 2011-04-17 14:24:47 -07:00
scottjehl
b649f17d9d one call to $.type 2011-04-17 12:11:03 -07:00
John Bender
2242684e59 added support for query params with dialog hash keys 2011-04-14 21:49:50 -07:00
John Bender
59bd1400ad check the url saved on the page element in the history stack to avoid checking agains the dialog nonsense url Fixes #1433 2011-04-14 21:49:50 -07:00
John Bender
aee4c631da removed stripQuery helper to reduce confusion and complexity as striping the query param from a url is much more complex than a hash as it was originally intended for 2011-04-12 01:14:05 -07:00
John Bender
a5add9a974 added handling for identical query param href/action on the same page 2011-04-12 00:58:24 -07:00
John Bender
8d3dc2cbc2 query param href/actions require absolute path prefixes when no relative path information is contained in the hash 2011-04-12 00:22:42 -07:00
John Bender
681f2a2073 handle relative query param links and forms Fixes #1160 2011-04-11 23:40:53 -07:00
John Bender
d6439d235f removed duplicate current page check in favor of fixing the off by one bug 2011-04-11 22:59:51 -07:00
John Bender
09b736a399 minor refactor from Scott's original suggestion on the issue 2011-04-10 22:59:06 -07:00
John Bender
c5ba91f0b9 navigation whitespace 2011-04-10 22:58:21 -07:00
scottjehl
3da5f05f75 wrapped the else if/else in an else to prevent an unnecessary dom walk until we have to make it. 2011-04-07 16:50:10 -04:00
scottjehl
97f5a9565f To ensure focus and scrollTo don't conflict (when possible), I set the focus order on page show to 1) previously clicked item if revisiting that page 2) page title 3) first focusable item in the page. Fixes #1342 2011-04-07 16:27:32 -04:00
scottjehl
b4088b9422 don't add the class to a disabled button. Fixes the checkbox test 2011-04-07 15:34:17 -04:00
scottjehl
cd0ad522ba moved the active state vclick to navigation 2011-04-07 15:28:52 -04:00
scottjehl
982b7d4b15 Make navigation feel more responsive through feedback, even though it actually uses the click event again for actual page changes.
- set active state on all button vclick events
- cancelled vclick on slider switch handles so it's not too sticky.
- removed addClass in navigation.js as the first change handles it there.
2011-04-07 14:41:45 -04:00
scottjehl
9a1b2dcb3c changed name of interal function loadComplete to pageChangeComplete 2011-04-07 11:33:04 -04:00
John Bender
05cc415f0c fix for current page links 2011-04-04 23:41:05 -07:00
Kin Blas
d43bbfc52a Switch back to hijacking links on the click event. We'll focus on improving "percieved" visual performance since launching a page load and transitions on vclick opens us up to too many problems:
- Third party click handlers never called.
	- Touch and click target mismatches due markup changes before the click events are generated. (What looks like a double click event)
2011-04-04 10:00:24 -07:00
John Bender
5c37beaa29 activeElement conditional for windows support Fixes #1294 2011-04-02 00:03:37 -07:00
Kin Blas
58369ec943 Added missing comma in var declaration. 2011-04-01 14:05:46 -07:00
Kin Blas
8cd0d2c679 I'm not sure how this happened, but the dataType fix for Issue 991 disappeared between commits 61005944 and 7503f62a.
Adding it back in to fix Issue 1349 - File urls still not working in alpha 4 as shipped.
2011-04-01 13:37:18 -07:00
John Bender
f2525b06de moved attribute call to jqmData call 2011-04-01 02:09:05 -07:00
John Bender
fad90ca99a navigation white space 2011-04-01 01:48:38 -07:00
Kin Blas
ae06612eca Clear our preventClickDefault and stopClickPropagation locals in the live click handler. 2011-03-31 14:39:11 -07:00
Kin Blas
3c69215ed6 Temporary workaround to keep 3rd party onclick handlers functioning. This stuff really needs to be done within the vmouse plugin. 2011-03-31 12:38:36 -07:00
scottjehl
07d20d9991 Merge remote branch 'origin/master' 2011-03-31 13:20:44 -04:00
scottjehl
ae6c2d569f fixed a duplicate check for using markup for page titles when title isn't present. 2011-03-31 13:20:19 -04:00
scottjehl
854885e93d move the pageTitle setter to different function 2011-03-31 12:56:48 -04:00
scottjehl
d8aac11a4f merging unit test addtions for page titles 2011-03-31 12:56:30 -04:00
scottjehl
ac7188e449 merging changes from page-titles branch in regards to a conflict with addNew function arguments 2011-03-31 12:48:46 -04:00
Kin Blas
16bea21a1c Corrected grammar for a comment in my previous checkin. 2011-03-31 09:33:05 -07:00
Kin Blas
0927ddfe3e Merge branch 'master' of https://github.com/jquery/jquery-mobile 2011-03-31 09:22:55 -07:00
Kin Blas
3ce228e3f2 On touch devices, 3rd party code that used href='#' links and onclick handlers weren't working because our live("vclick") link handler in jquery.mobile.navigation.js was calling preventDefault() on the vclick event.
For vclicks dispatched via touchend, calling preventDefault causes mouse clicks to be suppressed. This is why the 3rd party onclick handlers weren't getting triggered. For vclicks dispatched by a real mouse click this isn't a problem.

The fix basically removes the preventDefault() call from the live("vclick") handler and places it in a real live("click") handler. This allows the mouse event to get dispatched and trigger 3rd party click handlers, and still call preventDefault to prevent the link from being followed.
2011-03-31 09:19:05 -07:00
scottjehl
93ddf9d984 Syntax fix with data-ajax attr - also making sure [target] is included in the external link check, and that the pathname is removed properly in IE before prefixing. 2011-03-30 21:17:52 -04:00