Back button for customSelect listbox causes navigate to previous page.

- Added return false to the click handler attached to the back button in the select code.

- Modified the selectors for ui-back in mobilize so they only find back buttons in ui-header that are direct descendants of the ui-page.
This commit is contained in:
jblas@adobe.com 2010-10-06 00:22:25 -07:00
parent 5e34201ddc
commit f1f84ce77d
2 changed files with 3 additions and 2 deletions

View file

@ -136,6 +136,7 @@ $.fn.customSelect = function(options){
//back button
listbox.find('.ui-listbox-header a').click(function(){
select.trigger('hidemenu');
return false;
});

View file

@ -334,9 +334,9 @@
//add back buttons to headers that don't have them
// FIXME make that optional?
// TODO don't do that on devices that have a native back button?
var backBtn = $el.find('.ui-header a.ui-back');
var backBtn = $el.find('.ui-page > .ui-header a.ui-back');
if(!backBtn.length){
backBtn = jQuery('<a href="#" class="ui-back" data-icon="arrow-l"></a>').appendTo($el.find('.ui-header'));
backBtn = jQuery('<a href="#" class="ui-back" data-icon="arrow-l"></a>').appendTo($el.find('.ui-page > .ui-header'));
}
//buttons from links in headers,footers,bars, or with data-role