summaryrefslogtreecommitdiffstats
path: root/jquery.once.js
diff options
context:
space:
mode:
authorRob Loach <robloach@gmail.com>2015-01-02 23:06:49 -0500
committerRob Loach <robloach@gmail.com>2015-01-02 23:06:49 -0500
commit977005a6fac110aa47fb9c323294619d48010af0 (patch)
tree706a0184e2e190b6c8e3211b26f2d58de8ea29ca /jquery.once.js
parentd83f219e5a5719fe9cd9030b124091a5d73a25aa (diff)
downloadjquery-once-977005a6fac110aa47fb9c323294619d48010af0.zip
jquery-once-977005a6fac110aa47fb9c323294619d48010af0.tar.gz
jquery-once-977005a6fac110aa47fb9c323294619d48010af0.tar.bz2
Fix and update the inline code documentation - fixes #27
Diffstat (limited to 'jquery.once.js')
-rw-r--r--jquery.once.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/jquery.once.js b/jquery.once.js
index c333d31..afe8eb4 100644
--- a/jquery.once.js
+++ b/jquery.once.js
@@ -8,9 +8,9 @@
/**
* Universal Module Definition
*
- * jQuery is a dependency, so we wrap the code with a UMD pattern in order to
- * allow loading jQuery and jQuery Once through a module definition like
- * CommonJS, AMD, or otherwise.
+ * jQuery Once has a dependency on jQuery, so we wrap the code with a UMD
+ * pattern in order to allow loading jQuery and jQuery Once through a module
+ * definition like CommonJS, AMD, or through a global object.
*
* @see {@link http://github.com/umdjs/umd}
*/
@@ -87,11 +87,10 @@
* @public
*/
$.fn.once = function (id) {
- // Build the name for the data identifier. Generate a new unique ID if the
- // ID parameter is not provided.
+ // Build the jQuery Once data name from the provided ID.
var name = "jquery-once-" + checkId(id);
- // Filter the elements by which do not have the data yet.
+ // Find elements that don't have the jQuery Once data applied to them yet.
return this.filter(function() {
return $(this).data(name) !== true;
}).data(name, true);