fixed bug where clicking back twice after opening a dialog select was causing the main page to hide. history.back was being called twice in some cases when clicking the custom close button. Fixes #1007

This commit is contained in:
scottjehl 2011-03-15 18:23:24 -04:00
parent 83e7aeb4a5
commit 4e13021a53

View file

@ -264,22 +264,10 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
});
//events on "screen" overlay + close button
screen
.add( headerClose )
.add( menuPageClose )
.bind("click", function(event){
self.close();
event.preventDefault();
// if the dialog's close icon was clicked, prevent the dialog's close
// handler from firing. selectmenu's should take precedence
if( $.contains(menuPageClose[0], event.target) ){
event.stopImmediatePropagation();
}
});
screen.click(function( event ){
self.close();
});
}
},
_buildList: function(){
@ -415,6 +403,11 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
//add active class to button
self.button.addClass( $.mobile.activeBtnClass );
//remove after delay
setTimeout(function(){
self.button.removeClass( $.mobile.activeBtnClass );
}, 300);
function focusMenuItem(){
self.list.find( ".ui-btn-active" ).focus();
@ -504,9 +497,6 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
function focusButton(){
setTimeout(function(){
self.button.focus();
//remove active class from button
self.button.removeClass( $.mobile.activeBtnClass );
}, 40);
self.listbox.removeAttr('style').append( self.list );