Skip to content

Commit 44fd185

Browse files
committed
add spacing in code
1 parent 8c1559a commit 44fd185

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

src/angular-pnotify.js

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,35 @@
1414
var defaultStack = false;
1515

1616
var initHash = function(stackName) {
17+
1718
var hash = angular.copy(settings);
1819

1920
if ((stackName || (stackName = defaultStack)) && stackName in stacks) {
21+
2022
hash.stack = stacks[stackName].stack;
2123

2224
if (stacks[stackName].addclass) {
23-
hash.addclass = 'addclass' in hash ? hash.addclass + ' ' + stacks[stackName].addclass : stacks[stackName].addclass;
25+
26+
hash.addclass = 'addclass' in hash
27+
? hash.addclass + ' ' + stacks[stackName].addclass
28+
: stacks[stackName].addclass;
29+
2430
}
2531
}
2632

2733
return hash;
34+
2835
};
2936

3037
this.setDefaults = function(defaults) {
38+
3139
settings = defaults;
3240
return this;
41+
3342
};
3443

3544
this.setStack = function(name, addclass, stack) {
45+
3646
if (angular.isObject(addclass)) {
3747
stack = addclass;
3848
addclass = false;
@@ -42,12 +52,17 @@
4252
stack: stack,
4353
addclass: addclass
4454
};
55+
4556
return this;
57+
4658
};
4759

4860
this.setDefaultStack = function(name) {
61+
4962
defaultStack = name;
63+
5064
return this;
65+
5166
};
5267

5368
this.$get = [ function() {
@@ -57,51 +72,67 @@
5772
/* ========== SETTINGS RELATED METHODS =============*/
5873

5974
getSettings: function() {
75+
6076
return settings;
77+
6178
},
6279

6380
/* ============== NOTIFICATION METHODS ==============*/
6481

6582
notice: function(content, stack) {
83+
6684
var hash = initHash(stack);
6785
hash.type = 'notice';
6886
hash.text = content;
6987
return this.notify(hash);
88+
7089
},
7190

7291
info: function(content, stack) {
92+
7393
var hash = initHash(stack);
7494
hash.type = 'info';
7595
hash.text = content;
7696
return this.notify(hash);
97+
7798
},
7899

79100
success: function(content, stack) {
101+
80102
var hash = initHash(stack);
81103
hash.type = 'success';
82104
hash.text = content;
83105
return this.notify(hash);
106+
84107
},
85108

86109
error: function(content, stack) {
110+
87111
var hash = initHash(stack);
88112
hash.type = 'error';
89113
hash.text = content;
90114
return this.notify(hash);
115+
91116
},
92117

93118
notifyWithDefaults: function(options, stack) {
119+
94120
var defaults = initHash(stack);
95121
var combined = angular.extend(defaults, options);
96122
return this.notify(combined);
123+
97124
},
98125

99126
notify: function(hash) {
127+
100128
return new PNotify(hash);
129+
101130
},
102-
131+
103132
removeNotifications: function() {
133+
104134
return PNotify.removeAll();
135+
105136
}
106137

107138
};

0 commit comments

Comments
 (0)