handle all dialog closing cases

This commit is contained in:
John Bender 2011-09-23 16:15:56 -07:00
parent 4852491f9e
commit f029230e3a
2 changed files with 15 additions and 15 deletions

View file

@ -186,6 +186,20 @@
self.menuPage.bind( "pagehide", function() {
self.list.appendTo( self.listbox );
self._focusButton();
// TODO centralize page removal binding / handling in the page plugin.
// Suggestion from @jblas to do refcounting
//
// TODO extremely confusing dependency on the open method where the pagehide.remove
// bindings are stripped to prevent the parent page from disappearing. The way
// we're keeping pages in the DOM right now sucks
//
// 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
//
// doing this here provides for the back button on the custom select dialog
$.mobile._bindPageRemove.call( self.thisPage );
});
// Events on "screen" overlay
@ -261,14 +275,6 @@
var self = this;
if ( self.menuType == "page" ) {
// TODO centralize page removal binding / handling in the page plugin.
// Suggestion from @jblas to do refcounting
//
// 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
$.mobile._bindPageRemove.call( self.thisPage );
// 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
@ -322,11 +328,6 @@
});
}
// set the dialog close function to that of the custom dialog
self.menuPage.data( 'dialog' ).close = function() {
self.close();
};
self.menuPage.one( "pageshow", function() {
// silentScroll() is called whenever a page is shown to restore
// any previous scroll position the page may have had. We need to

View file

@ -658,7 +658,6 @@
&& page.is(":jqmData(external-page='true')") ) {
page.bind( 'pagehide.remove', function() {
debugger;
$( this ).removeWithDependents();
});
}
@ -700,7 +699,7 @@
absUrl = path.addSearchParams( absUrl, settings.data );
settings.data = undefined;
}
// If the caller is using a "post" request, reloadPage must be true
if( settings.data && settings.type === "post" ){
settings.reloadPage = true;