Skip to content

added: onClose method parameter to notify() constructor #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ The `messageTemplate` property is also included on the scope as `$messageTemplat


## Release History
* v2.0.3 - 09/10/2014
* Added onClose() method to notify constructor.
* v2.0.2 - 09/06/2014
* Default template redesigned with a Bootstrap look and feel. Default template now also includes a close button.
* Default message location is now the top center.
Expand Down
5 changes: 4 additions & 1 deletion angular-notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ angular.module('cgNotify', []).factory('notify',['$timeout','$http','$compile','
args.position = args.position ? args.position : position;
args.container = args.container ? args.container : container;
args.classes = args.classes ? args.classes : '';
args.onClose = args.onClose ? args.onClose : function () {return;};

var scope = args.scope ? args.scope.$new() : $rootScope.$new();
scope.$message = args.message;
scope.$classes = args.classes;
scope.$messageTemplate = args.messageTemplate;
scope.$onClose = args.onClose;

$http.get(args.templateUrl,{cache: $templateCache}).success(function(template){

Expand Down Expand Up @@ -66,6 +68,7 @@ angular.module('cgNotify', []).factory('notify',['$timeout','$http','$compile','
scope.$close = function(){
templateElement.css('opacity',0).attr('data-closing','true');
layoutMessages();
scope.$onClose();
};

var layoutMessages = function(){
Expand Down Expand Up @@ -101,7 +104,7 @@ angular.module('cgNotify', []).factory('notify',['$timeout','$http','$compile','
});

var retVal = {};

retVal.close = function(){
if (scope.$close){
scope.$close();
Expand Down
13 changes: 6 additions & 7 deletions bower_components/angular/.bower.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "angular",
"version": "1.2.16",
"version": "1.2.26",
"main": "./angular.js",
"dependencies": {},
"homepage": "https://github.com/angular/bower-angular",
"_release": "1.2.16",
"_release": "1.2.26",
"_resolution": {
"type": "version",
"tag": "v1.2.16",
"commit": "7ae38b4a0cfced157e3486a0d6e2d299601723bb"
"tag": "v1.2.26",
"commit": "7308d8d650b2b9948796035cbf6f3b175d45efe0"
},
"_source": "git://github.com/angular/bower-angular.git",
"_target": "~1.2.16",
"_originalSource": "angular",
"_direct": true
"_target": "~1.2",
"_originalSource": "angular"
}
Empty file modified bower_components/angular/README.md
100755 → 100644
Empty file.
6 changes: 6 additions & 0 deletions bower_components/angular/angular-csp.css
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ ng\:form {
transition:0s all!important;
-webkit-transition:0s all!important;
}

/* show the element during a show/hide animation when the
* animation is ongoing, but the .ng-hide class is active */
.ng-hide-add-active, .ng-hide-remove {
display: block!important;
}
Loading