Skip to content

Commit d53dc85

Browse files
authored
Merge pull request #96 from Jermorin/master
feat(container): add container option for those who need it
2 parents dbda103 + 3fc974d commit d53dc85

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "angular-ui-notification",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"homepage": "https://github.com/alexcrack/angular-ui-notification",
55
"repository": {
66
"type": "git",
7-
"url": "git://github.com/alexcrack/angular-ui-notification"
7+
"url": "git://github.com/jermorin/angular-ui-notification"
88
},
99
"authors": [
1010
"Alexey Avramchik"

demo/angular-ui-notification.min.js

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

dist/angular-ui-notification.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ angular.module('ui-notification').provider('Notification', function() {
2121
templateUrl: 'angular-ui-notification.html',
2222
onClose: undefined,
2323
closeOnClick: true,
24-
maxCount: 0 // 0 - Infinite
24+
maxCount: 0, // 0 - Infinite
25+
container: 'body'
2526
};
2627

2728
this.setOptions = function(options) {
@@ -57,6 +58,7 @@ angular.module('ui-notification').provider('Notification', function() {
5758
args.replaceMessage = args.replaceMessage ? args.replaceMessage : options.replaceMessage;
5859
args.onClose = args.onClose ? args.onClose : options.onClose;
5960
args.closeOnClick = (args.closeOnClick !== null && args.closeOnClick !== undefined) ? args.closeOnClick : options.closeOnClick;
61+
args.container = args.container ? args.container : options.container;
6062

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

@@ -143,7 +145,7 @@ angular.module('ui-notification').provider('Notification', function() {
143145

144146
setCssTransitions('none');
145147

146-
angular.element(document.getElementsByTagName('body')).append(templateElement);
148+
angular.element(document.querySelector(args.container)).append(templateElement);
147149
var offset = -(parseInt(templateElement[0].offsetHeight) + 50);
148150
templateElement.css(templateElement._positionY, offset + "px");
149151
messageElements.push(templateElement);

dist/angular-ui-notification.min.js

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

src/angular-ui-notification.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ angular.module('ui-notification').provider('Notification', function() {
1414
templateUrl: 'angular-ui-notification.html',
1515
onClose: undefined,
1616
closeOnClick: true,
17-
maxCount: 0 // 0 - Infinite
17+
maxCount: 0, // 0 - Infinite
18+
container: 'body'
1819
};
1920

2021
this.setOptions = function(options) {
@@ -50,6 +51,7 @@ angular.module('ui-notification').provider('Notification', function() {
5051
args.replaceMessage = args.replaceMessage ? args.replaceMessage : options.replaceMessage;
5152
args.onClose = args.onClose ? args.onClose : options.onClose;
5253
args.closeOnClick = (args.closeOnClick !== null && args.closeOnClick !== undefined) ? args.closeOnClick : options.closeOnClick;
54+
args.container = args.container ? args.container : options.container;
5355

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

@@ -136,7 +138,7 @@ angular.module('ui-notification').provider('Notification', function() {
136138

137139
setCssTransitions('none');
138140

139-
angular.element(document.getElementsByTagName('body')).append(templateElement);
141+
angular.element(document.querySelector(args.container)).append(templateElement);
140142
var offset = -(parseInt(templateElement[0].offsetHeight) + 50);
141143
templateElement.css(templateElement._positionY, offset + "px");
142144
messageElements.push(templateElement);

0 commit comments

Comments
 (0)