vendor/assets/javascripts/noty/jquery.noty.js in noty-rails-2.2.0 vs vendor/assets/javascripts/noty/jquery.noty.js in noty-rails-2.2.2
- old
+ new
@@ -1,7 +1,7 @@
/**
- * noty - jQuery Notification Plugin v2.2.0
+ * noty - jQuery Notification Plugin v2.2.2
* Contributors: https://github.com/needim/noty/graphs/contributors
*
* Examples and Documentation - http://needim.github.com/noty/
*
* Licensed under the MIT licenses:
@@ -221,11 +221,13 @@
self.closed = true;
}
delete $.noty.store[self.options.id]; // deleting noty from store
- self.options.theme.callback.onClose.apply(self);
+ if(self.options.theme.callback && self.options.theme.callback.onClose) {
+ self.options.theme.callback.onClose.apply(self);
+ }
if (!self.options.dismissQueue) {
// Queue render
$.noty.ontap = true;
@@ -352,11 +354,17 @@
notification.show();
};
$.notyRenderer.createModalFor = function (notification) {
- if ($('.noty_modal').length == 0)
- $('<div/>').addClass('noty_modal').data('noty_modal_count', 0).css(notification.options.theme.modal.css).prependTo($('body')).fadeIn('fast');
+ if ($('.noty_modal').length == 0) {
+ var modal = $('<div/>').addClass('noty_modal').addClass(notification.options.theme).data('noty_modal_count', 0);
+
+ if (notification.options.theme.modal && notification.options.theme.modal.css)
+ modal.css(notification.options.theme.modal.css);
+
+ modal.prependTo($('body')).fadeIn('fast');
+ }
};
$.notyRenderer.getLayoutCountFor = function (notification) {
return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
};