Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Fixes #4185 - When leaving from a page contains nested listview, page…
Browse files Browse the repository at this point in the history
…remove event does not fire
  • Loading branch information
jaspermdegroot committed May 3, 2012
1 parent ea55b07 commit 5b38553
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/jquery.mobile.listview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
};
Expand Down

0 comments on commit 5b38553

Please sign in to comment.