Skip to content

Commit e0f78cc

Browse files
committed
Fix merge conflicts
2 parents a34b97a + fc92bd7 commit e0f78cc

9 files changed

+52
-26
lines changed

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-ui-notification",
3-
"version": "0.3.0",
3+
"version": "0.3.5",
44
"homepage": "https://github.com/alexcrack/angular-ui-notification",
55
"repository": {
66
"type": "git",
@@ -31,9 +31,9 @@
3131
"build"
3232
],
3333
"dependencies": {
34-
"angular": "~1.2.23"
34+
"angular": "^1.5.x"
3535
},
3636
"devDependencies": {
37-
"bootstrap": "~3.3.2"
37+
"bootstrap": "^3.3.x"
3838
}
3939
}

demo/angular-ui-notification.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/angular-ui-notification.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-ui-notification.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* angular-ui-notification - Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating
33
* @author Alex_Crack
4-
* @version v0.2.0
4+
* @version v0.3.5
55
* @link https://github.com/alexcrack/angular-ui-notification
66
* @license MIT
77
*/

dist/angular-ui-notification.js

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* angular-ui-notification - Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating
33
* @author Alex_Crack
4-
* @version v0.2.0
4+
* @version v0.3.5
55
* @link https://github.com/alexcrack/angular-ui-notification
66
* @license MIT
77
*/
@@ -46,23 +46,38 @@ angular.module('ui-notification').provider('Notification', function() {
4646
var notify = function(args, t){
4747
var deferred = $q.defer();
4848

49-
if (typeof args !== 'object') {
49+
if (typeof args !== 'object' || args === null) {
5050
args = {message:args};
5151
}
5252

5353
args.scope = args.scope ? args.scope : $rootScope;
5454
args.template = args.templateUrl ? args.templateUrl : options.templateUrl;
5555
args.delay = !angular.isUndefined(args.delay) ? args.delay : delay;
56-
args.type = t || options.type || '';
56+
args.type = t || args.type || options.type || '';
5757
args.positionY = args.positionY ? args.positionY : options.positionY;
5858
args.positionX = args.positionX ? args.positionX : options.positionX;
5959
args.replaceMessage = args.replaceMessage ? args.replaceMessage : options.replaceMessage;
6060
args.onClose = args.onClose ? args.onClose : options.onClose;
6161
args.closeOnClick = (args.closeOnClick !== null && args.closeOnClick !== undefined) ? args.closeOnClick : options.closeOnClick;
6262
args.container = args.container ? args.container : options.container;
6363
args.priority = args.priority ? args.priority : options.priority;
64-
65-
$http.get(args.template,{cache: $templateCache}).success(function(template) {
64+
65+
var template=$templateCache.get(args.template);
66+
67+
if(template){
68+
processNotificationTemplate(template);
69+
}else{
70+
// load it via $http only if it isn't default template and template isn't exist in template cache
71+
// cache:true means cache it for later access.
72+
$http.get(args.template,{cache: true})
73+
.then(processNotificationTemplate)
74+
.catch(function(data){
75+
throw new Error('Template ('+args.template+') could not be loaded. ' + data);
76+
});
77+
}
78+
79+
80+
function processNotificationTemplate(template) {
6681

6782
var scope = args.scope.$new();
6883
scope.message = $sce.trustAsHtml(args.message);
@@ -211,9 +226,7 @@ angular.module('ui-notification').provider('Notification', function() {
211226

212227
deferred.resolve(scope);
213228

214-
}).error(function(data){
215-
throw new Error('Template ('+args.template+') could not be loaded. ' + data);
216-
});
229+
}
217230

218231
return deferred.promise;
219232
};

dist/angular-ui-notification.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)