summaryrefslogtreecommitdiffstats
path: root/jquery.once.min.js
diff options
context:
space:
mode:
authorThéodore Biadala <theodore@biadala.net>2014-12-15 11:39:38 +0100
committerThéodore Biadala <theodore@biadala.net>2014-12-15 11:39:38 +0100
commit779c426bf61ec43488a91bac78faf3971333e4cf (patch)
tree54a03afe7b3e83ec3489dd719a9b710896656e4c /jquery.once.min.js
parent03027a958db2e5af6c49156f97b8879cdc612a65 (diff)
downloadjquery-once-779c426bf61ec43488a91bac78faf3971333e4cf.zip
jquery-once-779c426bf61ec43488a91bac78faf3971333e4cf.tar.gz
jquery-once-779c426bf61ec43488a91bac78faf3971333e4cf.tar.bz2
Add a default value for once name and check once parameter is a string
fix #20
Diffstat (limited to 'jquery.once.min.js')
-rw-r--r--jquery.once.min.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/jquery.once.min.js b/jquery.once.min.js
index 45302c6..ff683be 100644
--- a/jquery.once.min.js
+++ b/jquery.once.min.js
@@ -1,4 +1,4 @@
-/*! jQuery Once - v2.0.0-alpha.9 - 10/16/2014 - https://github.com/RobLoach/jquery-once
+/*! jQuery Once - v2.0.0-alpha.9 - 12/15/2014 - https://github.com/RobLoach/jquery-once
* (c) 2014 Rob Loach (http://github.com/RobLoach)
* Licensed GPL-2.0, MIT */
-!function(a){"use strict";"object"==typeof exports?a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";a.fn.once=function(b){if(!b)throw new Error("An ID is required when calling jQuery.once()");var c="jquery-once-"+b;return this.filter(function(){return a(this).data(c)!==!0}).data(c,!0)},a.fn.removeOnce=function(a){return this.findOnce(a).removeData("jquery-once-"+a)},a.fn.findOnce=function(b){var c="jquery-once-"+b;return this.filter(function(){return a(this).data(c)===!0})}}); \ No newline at end of file
+!function(a){"use strict";"object"==typeof exports?a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";a.fn.once=function(b){if(b=b||"once","string"!=typeof b)throw new Error("jQuery.once() parameter MUST be a string");var c="jquery-once-"+b;return this.filter(function(){return a(this).data(c)!==!0}).data(c,!0)},a.fn.removeOnce=function(a){return this.findOnce(a).removeData("jquery-once-"+a)},a.fn.findOnce=function(b){var c="jquery-once-"+b;return this.filter(function(){return a(this).data(c)===!0})}}); \ No newline at end of file