Skip to content

Commit

Permalink
disable click to close
Browse files Browse the repository at this point in the history
  • Loading branch information
Chase Gray committed Sep 5, 2014
1 parent b20b35d commit a910139
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
16 changes: 9 additions & 7 deletions build/angular-growl.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ angular.module('angular-growl').directive('growl', [function () {
}
});
$scope.stopTimeoutClose = function (message) {
angular.forEach(message.promises, function (promise) {
$timeout.cancel(promise);
});
if (message.close) {
growlMessages.deleteMessage(message);
} else {
message.close = true;
if (!message.clickToClose) {
angular.forEach(message.promises, function (promise) {
$timeout.cancel(promise);
});
if (message.close) {
growlMessages.deleteMessage(message);
} else {
message.close = true;
}
}
};
$scope.alertClasses = function (message) {
Expand Down
2 changes: 1 addition & 1 deletion build/angular-growl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions src/growlDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ angular.module("angular-growl").directive("growl", [

//Cancels all promises within message upon deleting message or stop deleting.
$scope.stopTimeoutClose = function(message){
angular.forEach(message.promises, function(promise){
$timeout.cancel(promise);
});
if(message.close){
growlMessages.deleteMessage(message);
} else {
message.close = true;
if (!message.clickToClose) {
angular.forEach(message.promises, function(promise){
$timeout.cancel(promise);
});
if(message.close){
growlMessages.deleteMessage(message);
} else {
message.close = true;
}
}
};

Expand Down

0 comments on commit a910139

Please sign in to comment.