diff --git a/README.md b/README.md index e131dc8..e1f286b 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ The options list: | closeOnClick | true, false | true | If true, messages are closed on click | | maxCount | Any integer | 0 | Show only [maxCount] last messages. Old messages will be killed. 0 - do not kill | | priority | Any integer | 10 | The highier the priority is, the higher the notification will be | +| classes | Any string or array of it | [] | a classes that can be added to the whole notification div | Also you can pass the "scope" option. This is an angular scope option Notification scope will be inherited from. This option can be passed only in the methods. The default value is $rootScope diff --git a/src/angular-ui-notification.js b/src/angular-ui-notification.js index 71f2a8c..1c615cf 100644 --- a/src/angular-ui-notification.js +++ b/src/angular-ui-notification.js @@ -16,7 +16,8 @@ angular.module('ui-notification').provider('Notification', function() { closeOnClick: true, maxCount: 0, // 0 - Infinite container: 'body', - priority: 10 + priority: 10, + classes: [] }; this.setOptions = function(options) { @@ -54,7 +55,8 @@ angular.module('ui-notification').provider('Notification', function() { args.closeOnClick = (args.closeOnClick !== null && args.closeOnClick !== undefined) ? args.closeOnClick : options.closeOnClick; args.container = args.container ? args.container : options.container; args.priority = args.priority ? args.priority : options.priority; - + args.classes = args.classes ? (Array.isArray(args.classes)?args.classes:[args.classes]): options.classes; + var template=$templateCache.get(args.template); if(template){ @@ -143,6 +145,10 @@ angular.module('ui-notification').provider('Notification', function() { templateElement._positionX = args.positionX; templateElement._priority = args.priority; templateElement.addClass(args.type); + args.classes.forEach(function(item) { + templateElement.addClass(item); + }); + var closeEvent = function(e) { e = e.originalEvent || e;