scottjehl
b464b1bcec
added a workaround for the selectmenu plugin's nativeMenu in Opera. Opera browsers improperly support opacity on select elements, either hiding the menu button but not its text (in Mini), or hiding the text but not the button. Either way, it makes our hidden-select trick look really bad, or unusable. This workaround adds a class to the select in Opera, and makes the native menu visible. In the case of a false positive, that's not a bad outcome. Fixes #897
2011-02-02 12:04:18 -05:00
scottjehl
110ba9e98e
remove active button class on touchmove. This could technically use some tolerance, but it goes back to active if the select ends up opening, so I think it's fine as is, without adding more logic. Credit goes to @davibe for the change.
2011-02-02 01:41:07 -05:00
scottjehl
a763bade42
whitespace only
2011-02-02 00:33:53 -05:00
scottjehl
4a6ec54472
no default prevention is needed in native mode, as button is a div rather than an anchor. Also bound to change to remove the active class, which makes the native menu version's button state behave better in Opera Mobile 10.1
2011-02-02 00:25:12 -05:00
scottjehl
cfceeced2e
wrapped if condition order
2011-02-02 00:02:59 -05:00
scottjehl
91ee3fbfca
Merge remote branch 'origin/master'
2011-02-01 21:45:33 -05:00
scottjehl
0648247260
further shielding of non-native actions from native menus, and styled select within a parent div rather than anchor, when native is used.
2011-02-01 21:03:41 -05:00
scottjehl
36301b70bf
optimizations to prevent unnecessary overhead of menu markup creation or manipulation when native select option is true.
2011-02-01 20:49:07 -05:00
Kin Blas
179061a4c9
Fix for Issue #678 - Select list offset above top of screen.
...
- Wait for the "silentscroll" event before setting focus. This avoids the "feature" where the browser will automatically offset rendering of a container to make sure whatever has focus is visible.
2011-02-01 17:14:15 -08:00
scottjehl
70f4acdd04
selectmenu: moved the list building logic over to use an arrays and joins to speed things up.
2011-02-01 19:28:30 -05:00
scottjehl
aad8ac174a
Removed the extra ways to set nativeMenu option in select plugin. Now like other plugins, the option is both available through the plugin's options (nativeMenu) or through a data-attribute (data-native-menu), which is automated through the camelcase option name. Unit tests updated
2011-02-01 13:27:35 -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
scottjehl
29fbc9c3c5
removed the Position plugin and modified selectmenu to position its menu without it. Removes off about 3-4kb after minify.
2011-01-29 07:15:40 -08:00
scottjehl
b10c5c04c2
don't destroy dialogs on close. Now same-page dialogs can be reopened after close, and selects don't need to unbind dialog change events to override the destroy.
2011-01-28 14:30:24 -08:00
John Bender
e5fd56985c
added global native select configuration, docs to follow. Also corrected selector error when reloading a lib in tests
2011-01-27 23:20:57 -08:00
John Bender
b1d356bfd7
Merge branch 'nativeselectmenu'
2011-01-27 09:50:40 -08:00
John Bender
d94e25acd6
merge from origin selectmenu fixes
2011-01-26 21:35:00 -08:00
John Bender
b81248f238
fixed android select menu failure with a delay. I'm doubtful that this is the best solution to the problem but the cause was the click being passed through to the screen or the select menu itself a split second after opening. Open to alternatives. Fixes #873
2011-01-26 21:20:40 -08:00
scottjehl
61bee4e276
fixed issue with select menus not opening again after you close them.
2011-01-26 21:02:08 -05:00
John Bender
244e46b8ed
data-native attribute check for native select menus Fixes #847
2011-01-25 23:12:20 -08:00
John Bender
aa234961cc
whitespace correction on rebase fix
2011-01-25 22:50:55 -08:00
scottjehl
0cdf9df11c
added option for useNativeMenu. Should be updated so, when set, the custom menu markup is never created.
2011-01-25 22:43:53 -08:00
John Bender
b9bfa41846
poorly written comment
2011-01-15 23:36:59 -08:00
John Bender
f850311935
force previously created dialog for long menus. Fixes #807
2011-01-15 22:47:44 -08:00
John Bender
d4f4d474d1
whitespace cleanup for mobile forms select
2011-01-15 22:44:00 -08:00
scottjehl
7cf5aea8e3
fixed up those busted select menu headers. Fixes #810
2011-01-14 15:49:21 -05:00
scottjehl
3b92410ff3
some additional changes to make scrolling from a select button work ok.
2011-01-14 15:16:03 -05:00
scottjehl
288fe45ff1
added option for useNativeMenu. Should be updated so, when set, the custom menu markup is never created.
2011-01-14 13:02:24 -05:00
scottjehl
87c7b57da9
allow scroll to work when touch start begins on a select button. Fixes #804
2011-01-14 10:35:26 -05:00
Jonathan Hinkle
0413542753
rename selectmenu's exposed "options" to "optionElems" to avoid conflict with existing variable containing configuration options
2011-01-14 22:48:51 +08:00
ehynds
9e6a3df6b1
make sure the options cache is updated after a refresh, and that the click handler reads from this cache.
2011-01-12 22:01:50 +08: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
ehynds
edfafe0c01
if the close icon in a full-page select is clicked on, fire the selectmenu close handler instead of the dialog close handler
2010-12-23 13:19:34 -05:00
ehynds
c982b93794
fixed a bug in single selects where clicking on a selected option would un-select it. this logic should only apply to multiple selects.
2010-12-08 15:45:23 -05:00
ehynds
1d2ef4f606
removed console.log statement
2010-12-08 09:43:24 -05:00
ehynds
43a6a3bb1b
refactored header create logic to be consistent with the rest of the widget; fixed bug when using optgroups within a multiple select
2010-12-08 09:41:00 -05:00
ehynds
94ac0a88be
fix placeholder logic
2010-12-07 18:05:26 -05:00
ehynds
9e30e54159
removed extraneous comment
2010-12-07 15:49:54 -05:00
ehynds
8eb553f884
multiple select functionality
2010-12-07 15:45:20 -05:00
scottjehl
6dce87a2ac
hide placeholder options in selectmenu overlays. Fixes #607
2010-12-03 11:32:48 -05:00
ehynds
68150b5bec
adding optgroup support. Fixes #567
2010-12-03 10:57:21 -05:00
ehynds
8062bf0a80
finish merge of select_event_bubbling or whatever i called that branch
2010-12-03 10:47:25 -05:00
ehynds
e2eb9e9298
add disabled option support. fixes #350
2010-12-03 22:30:08 +08:00
ehynds
12f011b7cc
swap return false for event.preventDefault
2010-12-03 07:40:58 -05:00
scottjehl
d56380fc22
refactor of jquery.mobile.core.js. Moved all of the page navigation model related scripting into jquery.mobile.navigation.js. This includes event handling for click, submit, and hashchange, all of the base tag management, path management, active link class handling, etc. All existing core tests are passing, and all demos work as expected. More tests are needed in core, and this refactor should make those tests easier to write.
2010-11-25 06:13:51 -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
2ed21499d1
made sure address bar doesn't appear when opening select menu
2010-11-19 21:28:38 -05:00
scottjehl
a731e48e68
made sure select button gets active button class while open
2010-11-19 19:19:51 -05:00
scottjehl
76f5c26624
cleaned up css styles - ui-selectmenu instead of ui-listview
2010-11-19 19:15:48 -05:00
scottjehl
b2e306c667
removed theme coloring for selectmenu screen when in overlay mode.
2010-11-19 17:32:09 -05:00