Cleanup jQuery doc references. [ci skip]

This commit is contained in:
John-David Dalton
2015-12-15 00:28:47 -08:00
parent 0bf38b826e
commit 003a5981d6

View File

@@ -8102,7 +8102,7 @@
* @returns {Function} Returns the new restricted function. * @returns {Function} Returns the new restricted function.
* @example * @example
* *
* jQuery('#add').on('click', _.before(5, addContactToList)); * jQuery(element).on('click', _.before(5, addContactToList));
* // => allows adding up to 4 contacts to the list * // => allows adding up to 4 contacts to the list
*/ */
function before(n, func) { function before(n, func) {
@@ -8189,8 +8189,8 @@
* }; * };
* *
* _.bindAll(view, 'onClick'); * _.bindAll(view, 'onClick');
* jQuery('#docs').on('click', view.onClick); * jQuery(element).on('click', view.onClick);
* // => logs 'clicked docs' when the element is clicked * // => logs 'clicked docs' when clicked
*/ */
var bindAll = rest(function(object, methodNames) { var bindAll = rest(function(object, methodNames) {
arrayEach(baseFlatten(methodNames), function(key) { arrayEach(baseFlatten(methodNames), function(key) {
@@ -8378,34 +8378,19 @@
* // avoid costly calculations while the window size is in flux * // avoid costly calculations while the window size is in flux
* jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
* *
* // invoke `sendMail` when the click event is fired, debouncing subsequent calls * // invoke `sendMail` when clicked, debouncing subsequent calls
* jQuery('#postbox').on('click', _.debounce(sendMail, 300, { * jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true, * 'leading': true,
* 'trailing': false * 'trailing': false
* })); * }));
* *
* // ensure `batchLog` is invoked once after 1 second of debounced calls * // ensure `batchLog` is invoked once after 1 second of debounced calls
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream'); * var source = new EventSource('/stream');
* jQuery(source).on('message', _.debounce(batchLog, 250, { * jQuery(source).on('message', debounced);
* 'maxWait': 1000
* }));
* *
* // cancel a debounced invocation * // cancel a trailing debounced invocation
* var todoChanges = _.debounce(batchLog, 1000); * jQuery(window).on('popstate', debounced.cancel);
* Object.observe(models.todo, todoChanges);
*
* Object.observe(models, function(changes) {
* if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
* todoChanges.cancel();
* }
* }, ['delete']);
*
* // ...at some point `models.todo` is changed
* models.todo.completed = true;
*
* // ...before 1 second has passed `models.todo` is deleted
* // which cancels the debounced `todoChanges` invocation
* delete models.todo;
*/ */
function debounce(func, wait, options) { function debounce(func, wait, options) {
var args, var args,
@@ -8967,9 +8952,8 @@
* jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
* *
* // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
* jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
* 'trailing': false * jQuery(element).on('click', throttled);
* }));
* *
* // cancel a trailing throttled invocation * // cancel a trailing throttled invocation
* jQuery(window).on('popstate', throttled.cancel); * jQuery(window).on('popstate', throttled.cancel);