fix(popup): prevent back to back popups from dismissing background. Fixes #2071

This commit is contained in:
Perry Govier
2014-09-26 16:43:27 -05:00
parent 10068e2219
commit 5658a4df0c
2 changed files with 4 additions and 2 deletions

View File

@@ -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;

View File

@@ -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) {