Bump to 0.4.1, see description

* IE9 fix
* code cleanup
* publish to npm (closes #31)
* jquery is now a peerDep (closes #53)
* improve positioning documentation
* dont reuse element notifications, always recreate (closes #43)
This commit is contained in:
Jaime Pillora
2015-12-06 00:53:19 +11:00
parent 7b0164fc63
commit b99c2ae69c
5 changed files with 15 additions and 34 deletions
+8 -9
View File
@@ -522,7 +522,8 @@
};
Notification.prototype.destroy = function() {
return this.wrapper.remove();
this.wrapper.data(pluginClassName, null);
this.wrapper.remove();
};
$[pluginName] = function(elem, data, options) {
@@ -538,13 +539,11 @@
$.fn[pluginName] = function(data, options) {
$(this).each(function() {
var inst;
inst = getAnchorElement($(this)).data(pluginClassName);
if (inst) {
return inst.run(data, options);
} else {
return new Notification($(this), data, options);
var prev = getAnchorElement($(this)).data(pluginClassName);
if (prev) {
prev.destroy();
}
var curr = new Notification($(this), data, options);
});
return this;
};
@@ -603,9 +602,9 @@
$(function() {
insertCSS(coreStyle.css).attr("id", "core-notify");
$(document).on("click", "." + pluginClassName + "-hidable", function(e) {
return $(this).trigger("notify-hide");
$(this).trigger("notify-hide");
});
return $(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) {
$(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) {
var elem = $(this).data(pluginClassName);
if(elem) {
elem.show(false);