Permalink
Browse files

Fixes #4185 - When leaving from a page contains nested listview, page…

…remove event does not fire
  • Loading branch information...
1 parent ea55b07 commit 5b3855315ac328a55663bccb4bbcde383a9b59eb @jaspermdegroot jaspermdegroot committed May 3, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 js/jquery.mobile.listview.js
@@ -380,13 +380,17 @@ $.widget( "mobile.listview", $.mobile.widget, {
parentPage.data("page").options.domCache === false ) {
var newRemove = function( e, ui ){
- var nextPage = ui.nextPage, npURL;
+ var nextPage = ui.nextPage, npURL,
+ prEvent = new $.Event( "pageremove" );
if( ui.nextPage ){
npURL = nextPage.jqmData( "url" );
if( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ){
self.childPages().remove();
- parentPage.remove();
+ parentPage.trigger( prEvent );
+ if( !prEvent.isDefaultPrevented() ){
+ parentPage.removeWithDependents();
+ }
}
}
};

0 comments on commit 5b38553

Please sign in to comment.