From 1ab34e4b96eb50911b325bd0f242cbac52f5ab3d Mon Sep 17 00:00:00 2001 From: bmomani1 Date: Sun, 12 Nov 2017 20:11:19 +0200 Subject: [PATCH 1/2] add a classes option these classes will be added templateElement div to allow more flixability with notification design --- src/angular-ui-notification.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; From 285c10fee419a4612c7d9585ba009b8f4a70ce07 Mon Sep 17 00:00:00 2001 From: bmomani1 Date: Sun, 12 Nov 2017 20:14:07 +0200 Subject: [PATCH 2/2] add documenatation for new classes optin --- README.md | 1 + 1 file changed, 1 insertion(+) 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