mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
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:
parent
83e7aeb4a5
commit
4e13021a53
1 changed files with 8 additions and 18 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue