Skip to content

Instantly share code, notes, and snippets.

@neilmaledev
Created September 25, 2017 02:09
Show Gist options
  • Save neilmaledev/8cae2f59265957cc7800adeceb44bbe3 to your computer and use it in GitHub Desktop.
Save neilmaledev/8cae2f59265957cc7800adeceb44bbe3 to your computer and use it in GitHub Desktop.
noop = angular.noop;
elevated = false;
var popupStack = $ionicPopup._popupStack;
if (popupStack.length > 0) {
popupStack.forEach(function(popup, index) {
if (popup.isShown === true) {
popup.hide();
popup.remove();
popupStack.pop();
}
});
}
$ionicBackdrop.release();
//Remove popup-open & backdrop if this is last popup
$timeout(function() {
// wait to remove this due to a 300ms delay native
// click which would trigging whatever was underneath this
$ionicBody.removeClass('popup-open');
$ionicBody.removeClass('modal-open');
// $ionicPopup._popupStack.pop();
}, 500, false);
($ionicPopup._backButtonActionDone || noop)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment