Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for cached page removal breaking dialog sized select menus Fixes #…

  • Loading branch information...
commit f1d964e9e9b1d6e48325d00a13b22ac0771305ac 1 parent f7d5d91
@johnbender johnbender authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 js/jquery.mobile.forms.select.js
View
12 js/jquery.mobile.forms.select.js
@@ -230,7 +230,6 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
})
.delegate( "li:not(.ui-disabled, .ui-li-divider)", "vclick", function( event ) {
-
var $this = $( this ),
// index of option tag to be selected
oldIndex = select[ 0 ].selectedIndex,
@@ -484,6 +483,10 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
}
if ( menuHeight > screenHeight - 80 || !$.support.scrollTop ) {
+ // prevent the parent page from being removed from the DOM,
+ // otherwise the results of selecting a list item in the dialog
+ // fall into a black hole
+ self.thisPage.unbind( "pagehide.remove" );
//for webos (set lastscroll using button offset)
if ( scrollTop == 0 && btnOffset > screenHeight ) {
@@ -577,6 +580,13 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
var self = this;
if ( self.menuType == "page" ) {
+ // rebind the page remove that was unbound in the open function
+ // to allow for the parent page removal from actions other than the use
+ // of a dialog sized custom select
+ self.thisPage.bind( "pagehide.remove", function(){
+ $(this).remove();
+ });
+
// doesn't solve the possible issue with calling change page
// where the objects don't define data urls which prevents dialog key
// stripping - changePage has incoming refactor
Please sign in to comment.
Something went wrong with that request. Please try again.