Skip to content

Commit

Permalink
fix(popup): make sure backdrop is always released
Browse files Browse the repository at this point in the history
Closes #3524.
  • Loading branch information
ajoslin committed Apr 15, 2015
1 parent 4a65807 commit 31de853
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions js/angular/service/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
} else {
//Add popup-open & backdrop if this is first popup
$ionicBody.addClass('popup-open');
console.log("RETAIN");
$ionicBackdrop.retain();
//only show the backdrop on the first popup
$ionicPopup._backButtonActionDone = $ionicPlatform.registerBackButtonAction(
Expand Down Expand Up @@ -409,6 +410,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
popupStack.splice(index, 1);
}
popup.remove();
$ionicBackdrop.release();

if (popupStack.length > 0) {
popupStack[popupStack.length - 1].show();
Expand All @@ -421,9 +423,6 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
$ionicBody.removeClass('popup-open');
}
}, 400, false);
$timeout(function() {
if (!popupStack.length) $ionicBackdrop.release();
}, config.stackPushDelay || 0, false);

($ionicPopup._backButtonActionDone || noop)();
}
Expand Down

1 comment on commit 31de853

@MehulATL
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.