Skip to content
/ noty Public

Commit a890c54

Browse files
committed
Resolve #210 #204
1 parent bb3c9b3 commit a890c54

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

demo/usingWithModal.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
text : type,
4646
type : type,
4747
dismissQueue: true,
48+
closeWith : ['click', 'backdrop'],
4849
modal : true,
4950
layout : 'topCenter',
5051
theme : 'defaultTheme',

js/noty/jquery.noty.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@ if(typeof Object.create !== 'function') {
171171
function() {
172172
self.close.apply(self);
173173
}
174-
)
174+
);
175175
return;
176176
}
177177

178+
this.$bar.dequeue();
179+
178180
if(!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue
179181
var queue = [];
180182
$.each($.noty.queue, function(i, n) {
@@ -370,6 +372,11 @@ if(typeof Object.create !== 'function') {
370372
modal.css(notification.options.theme.modal.css);
371373

372374
modal.prependTo($('body')).fadeIn('fast');
375+
376+
if($.inArray('backdrop', notification.options.closeWith) > -1)
377+
modal.on('click', function(e) {
378+
$.noty.closeAll();
379+
});
373380
}
374381
};
375382

js/noty/packaged/jquery.noty.packaged.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@ if(typeof Object.create !== 'function') {
171171
function() {
172172
self.close.apply(self);
173173
}
174-
)
174+
);
175175
return;
176176
}
177177

178+
this.$bar.dequeue();
179+
178180
if(!this.shown && !this.showing) { // If we are still waiting in the queue just delete from queue
179181
var queue = [];
180182
$.each($.noty.queue, function(i, n) {
@@ -370,6 +372,11 @@ if(typeof Object.create !== 'function') {
370372
modal.css(notification.options.theme.modal.css);
371373

372374
modal.prependTo($('body')).fadeIn('fast');
375+
376+
if($.inArray('backdrop', notification.options.closeWith) > -1)
377+
modal.on('click', function(e) {
378+
$.noty.closeAll();
379+
});
373380
}
374381
};
375382

0 commit comments

Comments
 (0)