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

Commit

Permalink
feat(modal): expose dismissAll on $modalStack
Browse files Browse the repository at this point in the history
Closes #1334
Closes #1552
  • Loading branch information
pkozlowski-opensource committed Jan 11, 2014
1 parent 42a029f commit bc8d21c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition'])
}
};

$modalStack.dismissAll = function (reason) {
var topModal = this.getTop();
while (topModal) {
this.dismiss(topModal.key, reason);
topModal = this.getTop();
}
};

$modalStack.getTop = function () {
return openedWindows.top();
};
Expand Down
1 change: 0 additions & 1 deletion src/modal/test/modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ describe('$modal', function () {
expect($document).toHaveModalOpenWithContent('Content', 'div');
expect($document).not.toHaveBackdrop();
});

});

describe('option by option', function () {
Expand Down

0 comments on commit bc8d21c

Please sign in to comment.