Commit graph

65 commits

Author SHA1 Message Date
scottjehl
fd0819f379 turned auto back button additions off by default. Fixes #1657. To turn auto backbuttons on, you can set the page plugin's autoBackBtn option to true per page, or globally via its configuration prototype. You can also use the data-auto-back-btn attribute on a page div. 2011-05-18 17:17:13 -04:00
scottjehl
4f4718731f Incorporating mariozaizar's changes to add a backBtnTheme option (null by default) to the page plugin. A few edits were needed to support namespacing and a proper null default so theme inheritance is the default. 2011-03-27 18:29:45 -04:00
scottjehl
d59ba5a31a moved a couple of concats over to :jqmData() selector 2011-03-26 10:09:52 -04:00
scottjehl
7503f62a10 changed our two new custom data helper names to jqmData() and :jqmData() 2011-03-25 17:50:40 -04:00
Kin Blas
db89e1f24d Switch find/filter selector calls over to using the new :jqdata() pseudo selector. 2011-03-22 13:31:17 -07:00
John Bender
63e8f6bfcb resolved merge conflicts and fixed 2 tests 2011-03-15 23:57:17 -07:00
John Bender
a987adb610 altered type attribute regex per @jblas, moved to 'private' prototype attribute for testing 2011-03-14 23:50:20 -07:00
John Bender
84ac4ebbb2 fixed input type regex for ff. It puts the type attribute at the end of the html string and breaks the trailing space. Checked in ie7 2011-03-14 08:22:44 -07:00
scottjehl
793d03b2e6 adjusted input element replacement regexp to account for non-quoted type attributes when replacing markup. This change lets things work properly in IE, so plugins like the slider now get enhanced. 2011-03-14 00:20:24 -04:00
scottjehl
ea60207c1b changed custom data method to $.fn.mobileData() and updated plugins that use it. 2011-03-09 23:27:21 -05:00
scottjehl
19f5fd7cae changed the default namespace to "" and updated the docs/demos as such 2011-03-09 22:36:14 -05:00
scottjehl
be0634efb8 fixed typo in class 2011-03-09 21:30:22 -05:00
scottjehl
9e91fa6752 updated docs with jq namespace, found some more stragglers 2011-03-09 21:03:40 -05:00
scottjehl
ce34ece257 namespaced data- attrs to $.mobile.ns (defaults to "jq-") throughout the JS 2011-03-09 20:47:44 -05:00
scottjehl
bd79c32c9a Page min-height was being calculated with JS and it was far too tall. This moves the values into CSS with values that are aimed towards iPhone (as this is addressing an iPhone transitions issue with the address bar show/hide). 2011-02-03 17:22:23 -05:00
scottjehl
eb2845d1dc fixed one additional back button condition mentioned in issue #930 where the back button is added to a page that is directly linked with no hash. All navigation tests passing. https://github.com/jquery/jquery-mobile/issues/issue/930 2011-02-01 00:32:59 -05:00
scottjehl
b3a8230638 This commit includes simplifications to the hashchange event handling & changePage logic, which results in a few bug fixes and removal of some previous limitations. Details:
- jquery.mobile.core.js  no longer creates pages from every page and dialog in the DOM automatically at domready. Instead, pages are created as they are referenced via changePage, which can speed up pageload in multi-page documents, and means local "dialogs" referenced via data-rel="dialog" no longer need a data-role="dialog" attribute when served.

- in changePage, "from" is now allowed to be undefined. This simplifies the logic involved in showing the first page, which never had a "from" page, and previously needed a custom pageChange workaround to accommodate that.

- The pageshow event is no longer used as a callback for returning false and preventing the $.mobile.activePage from being set to the newly shown page. In other words, a page always becomes $.mobile.activePage once its shown now (the only reason this was optional before was because of a dialog restriction that's no longer true)

- the hashchange event logic for showing a particular page is now greatly simplified. It either shows the page referenced in location.hash, or if there's no hash it changes to the first page in the dom. This means every pageshow (including the first one) now uses pageChange internally.

- the hashchange event listener is no longer disabled when ajaxEnabled == false. Doing this before prevented local non-ajax page navigation from working properly. To disable hashchange listening, use $.mobile.urlHistory.listeningEnabled. We might consider defining (or moving) this on the $.mobile hash later as well for easier access.

- The internal var $.mobile.startPage is now $.mobile.firstPage, because it's not necessarily the page you started on, but merely a reference to the first "page" in the dom.

- Back buttons are auto-added to every page after the first one you first visit (this includes generated pages, such as those in a multipage document or nested listviews). Keep in mind that a "back" button does not take the place of a standard "home" link, and when building an app with jQuery Mobile, it's good to make use of both (particularly on deep-linked pages). Fixes #908
2011-01-31 17:05:57 -05:00
Jesse Streb
d3077b491c [455] Am now setting the min-height of a page so that the address bar can always be hidden on a silent scroll. This helps our transitions feel smoother as the page does not jump down if the page is not taller then 100% of the window. On orientation change we also update this value. 2011-01-27 12:28:04 -05:00
scottjehl
e2c66fad49 Merge remote branch 'origin/master' 2011-01-26 22:15:10 -08:00
scottjehl
d1976fa265 removed click handler on back button - used data-rel='back' instead. 2011-01-26 18:57:14 -05:00
scottjehl
fa2b1903de only add a back button when there's a history entry to return to. 2011-01-26 17:56:20 -05:00
Kin Blas
63a82967fa Temporary workaround for Issue 785 - jQM text input forces use of iOS auto-correction.
- Added code to enhanceControls() that sets the autocorrect and autocomplete attributes on all inputs of type="text" to "off". This basically disables the use of autocorrection on iOS.

- Modified the code in enhanceControls() to cache the form controls query to reduce the number of times we search for controls in the current page.
2011-01-26 14:31:47 -08:00
scottjehl
9b57c46349 Refactored urlStack and updated dialog and page plugins to match. jQuery Mobile's internal history now attempts to follow the history menu when urls change from hashchange, even for changes that go multiple steps forward or back. The internal history stack is now pruned based on whether a user goes back and then changes direction, whereas before a back-button click would result in a pop off the history. Instead we now maintain an active index number in the history stack, which allows us to maintain references to transitions that are saved on pages reached through clicking the forward button as well. This fixes #636.
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.
2011-01-23 17:33:36 -05:00
scottjehl
44d6064fb6 Merge branch 'no_enhance_for_hidden' of https://github.com/hynkle/jquery-mobile into hynkle-no_enhance_for_hidden 2011-01-11 13:42:30 -05:00
Kin Blas
8a70cdb3de Initial patch from pull 672 had incorrect check for backbtn data value. Changed it from $this.data("backbtn") === false to $this.data("backbtn") !== false to match the original logic that was in place prior to the patch.
Original patch missed a nobackbtn reference in jquery.mobile.forms.select.js.
2011-01-11 09:34:50 -08:00
Kin Blas
8050fb0d01 Merge branch 'master' of https://github.com/walkingeyerobot/jquery-mobile into pull672 2011-01-11 09:04:32 -08:00
Jonathan Hinkle
6b799dad71 added 'hidden' to the types of inputs not to be enhanced by textinput 2011-01-07 12:33:59 -05:00
maggiewachs
926982b4f0 Fixed bug 595, where form elements were not properly inheriting the theme. Form controls need to be enhanced after the page containers so they'll pick up on the containers' theme classes. 2011-01-05 11:55:41 -05:00
Mitch Foley
ad757718c4 actually reversing backbtn logic this time. 2010-12-13 11:11:21 -05:00
Mitch Foley
df3bc91f80 renaming nobackbtn to backbtn. 2010-12-13 10:54:26 -05:00
John Bender
553b58567f added protection for nested links to ui-bar selector with tests 2010-12-09 00:16:48 -08:00
John Bender
970f46c5e0 header and footer links will now remain unstyled, Fixes #524 2010-12-08 22:16:45 -08:00
scottjehl
17f0340a0a improved keepNative option so that it's additive on top of data-role=none and data-role=nojs. 2010-12-01 09:52:07 -05:00
scottjehl
efe4c38ad4 added the keepNative option to page plugin, which defaults to this selector "[data-role='none'], .ui-nojs". Add the attribute data-role="none" to any form control or anchor and it will not be auto-enhanced. Thx @pharaoh for the syntax suggestion. Fixes #544, Fixes #528, Fixes #529 2010-11-30 18:18:53 -05:00
scottjehl
93179f9a3d updated comment about license to match other jQuery projects - MIT "or" GPL 2010-11-19 22:47:47 -05:00
scottjehl
e89ebc126e Input types can now degrade to alternate types, instead of text. First such example is type=range degrades to type=number. Fixes issue #415, Fixes #404 2010-11-11 21:43:01 -05:00
scottjehl
a24196e550 dolla dolla bills y'all.
Fixes #126, Fixes #346
2010-11-11 10:50:28 -05:00
scottjehl
12b1bb4fa2 only degrade input types that conflict with our replacement UI control. For now, just search and range. Fixes #415, Fixes #420 2010-11-10 11:22:56 -05:00
scottjehl
356308e6b7 updates to comments 2010-11-09 19:55:52 -05:00
scottjehl
f7a29fc201 converted selectmenu widget to the widget factory. 2010-11-08 19:33:45 -05:00
scottjehl
cdbccc2802 moved page-plugin-related options to the page plugin (backBtnText, addBackBtn, degradeInputs). 2010-11-06 13:45:09 -04:00
scottjehl
ffa682cbfe Converted textinput plugin to use widget factory. Also added enable and disable methods. Fixes #369 2010-11-04 21:32:28 -04:00
scottjehl
9352d75487 removed ajaxform role 2010-11-01 23:53:35 -04:00
scottjehl
f733dbb518 revised last commit - only header and footer inherit theming. content is left unthemed unless specified. 2010-11-01 22:54:41 -04:00
scottjehl
9ff1a1be6d allow header, content, and footer to inherit theming from the page element, if unspecified on the elements themselves. Fixes #282 2010-11-01 22:43:51 -04:00
scottjehl
7d03d097bf rewrote checkboxradio to use widget factory. renamed method checkboxradio and updated page plugin to match 2010-10-27 22:38:02 -04:00
scottjehl
e202a72776 converted customButton plugin to widget factory (note: this is just the plugin for native button elements, not to be confused with the buttonMarkup plugin).
renamed method to "button" and updated page.js to match
2010-10-27 20:43:27 -04:00
John Resig
8208b6b986 Minor tweaks to page formatting. 2010-10-22 12:22:57 -04:00
John Resig
a07bcbaa8b Minor tweaks to page logic. 2010-10-22 12:17:14 -04:00
John Resig
c8b5728c21 Fix issues with button rendering. 2010-10-22 11:39:26 -04:00