diff --git a/README.md b/README.md index da7f2b8..520f3de 100644 --- a/README.md +++ b/README.md @@ -5,28 +5,10 @@ Notify.js See demos and full documentation at: -## http://notifyjs.com/ +## https://notifyjs.com/ -SYNOPSIS -==== - -Global Notifications ---- - $.notify("Hello World"); - -Element Notifications ----- - - $(".elem-demo").notify("Hello World"); - - // where x is one letter: [t]op [m]iddle [b]ottom - // where y is one letter: [l]eft [c]enter [r]ight - $(".elem-demo").notify("Hello World", {position: "x y"}); - -COPYRIGHT -==== - Notify.js is released under the [MIT License](https://opensource.org/licenses/MIT). Copyright © Jaime Pillora <dev@jpillora.com> diff --git a/bower.json b/bower.json index aa22049..8f7529e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "notifyjs", - "version": "0.3.4", + "version": "0.4.1", "homepage": "http://notifyjs.com/", "authors": [ "Jaime Pillora " diff --git a/dist/notify.js b/dist/notify.js index ad4112e..aed93e6 100644 --- a/dist/notify.js +++ b/dist/notify.js @@ -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); diff --git a/notify.jquery.json b/notify.jquery.json index f68c799..c9d4c96 100644 --- a/notify.jquery.json +++ b/notify.jquery.json @@ -1,6 +1,6 @@ { "name": "notify", - "version": "0.3.4", + "version": "0.4.1", "title": "notify", "description": "A robust, customizable notification library", "bugs": "https://github.com/jpillora/notifyjs/issues", diff --git a/package.json b/package.json index 6273733..9fd3421 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "Notify.js", - "name": "notify", - "version": "0.4.0", + "name": "notifyjs-browser", + "version": "0.4.1", "author": { "name": "Jaime Pillora" }, @@ -19,7 +19,7 @@ "test": "npm run lint", "lint": "jshint ./dist/*.js" }, - "dependencies": { + "peerDependencies": { "jquery": "^2.1.4" }, "devDependencies": { @@ -30,6 +30,6 @@ "notification", "prompt", "popup", - "jquery-plugin" + "jquery-plugin" ] }