summaryrefslogtreecommitdiffstats
path: root/jquery.once.js
diff options
context:
space:
mode:
authorRob Loach <robloach@gmail.com>2014-10-07 15:41:55 -0400
committerRob Loach <robloach@gmail.com>2014-10-07 15:41:55 -0400
commit8488a8c2c1f2cedfd213b20ad46e1044e391c9d3 (patch)
tree7acd00cb9f6d6205cc8848f34a6be500d378ccce /jquery.once.js
parent1984238124a32c2b979105e586a6e510c15bd8a9 (diff)
downloadjquery-once-8488a8c2c1f2cedfd213b20ad46e1044e391c9d3.zip
jquery-once-8488a8c2c1f2cedfd213b20ad46e1044e391c9d3.tar.gz
jquery-once-8488a8c2c1f2cedfd213b20ad46e1044e391c9d3.tar.bz2
Remove cache variable
Diffstat (limited to 'jquery.once.js')
-rw-r--r--jquery.once.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/jquery.once.js b/jquery.once.js
index dd825f4..affaaed 100644
--- a/jquery.once.js
+++ b/jquery.once.js
@@ -9,16 +9,12 @@
factory(jQuery);
}
})(function($) {
- var cache, uuid;
- cache = {};
+ var uuid;
uuid = 0;
$.fn.once = function(id) {
var name;
- if (typeof id !== "string") {
- if (!(id in cache)) {
- cache[id] = ++uuid;
- }
- id = cache[id];
+ if (!id) {
+ id = ++uuid;
}
name = "jquery-once-" + id;
return this.filter(function() {