Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit bc8d21c

Browse files
committedJan 11, 2014
feat(modal): expose dismissAll on $modalStack
Closes #1334 Closes #1552
1 parent 42a029f commit bc8d21c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

‎src/modal/modal.js

+8
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,14 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
250250
}
251251
};
252252

253+
$modalStack.dismissAll = function (reason) {
254+
var topModal = this.getTop();
255+
while (topModal) {
256+
this.dismiss(topModal.key, reason);
257+
topModal = this.getTop();
258+
}
259+
};
260+
253261
$modalStack.getTop = function () {
254262
return openedWindows.top();
255263
};

‎src/modal/test/modal.spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ describe('$modal', function () {
229229
expect($document).toHaveModalOpenWithContent('Content', 'div');
230230
expect($document).not.toHaveBackdrop();
231231
});
232-
233232
});
234233

235234
describe('option by option', function () {

0 commit comments

Comments
 (0)