mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(popup): prevent back to back popups from dismissing background. Fixes #2071
This commit is contained in:
4
js/angular/service/popup.js
vendored
4
js/angular/service/popup.js
vendored
@@ -403,7 +403,9 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
|
||||
// click which would trigging whatever was underneath this
|
||||
$ionicBody.removeClass('popup-open');
|
||||
}, 400);
|
||||
$ionicBackdrop.release();
|
||||
$timeout(function(){
|
||||
if(popupStack.length === 0)$ionicBackdrop.release();
|
||||
}, config.stackPushDelay || 0);
|
||||
($ionicPopup._backButtonActionDone || angular.noop)();
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -265,9 +265,9 @@ describe('$ionicPopup service', function() {
|
||||
$ionicPopup.show();
|
||||
fakePopup.responseDeferred.resolve();
|
||||
$timeout.flush();
|
||||
expect($ionicBackdrop.release).toHaveBeenCalled();
|
||||
expect(backDoneSpy).toHaveBeenCalled();
|
||||
$timeout.flush();
|
||||
expect($ionicBackdrop.release).toHaveBeenCalled();
|
||||
expect(document.body.classList.contains('popup-open')).toBe(false);
|
||||
}));
|
||||
it('template should only overwrite prompt input if it includes html', inject(function($timeout) {
|
||||
|
||||
Reference in New Issue
Block a user