Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/208330

Change subject: Alias ve.debounce to OO.ui.debounce
......................................................................

Alias ve.debounce to OO.ui.debounce

Depends on Iefcba48 in oojs-ui.

Change-Id: I1e181acc116e5a4b4c7a271dd559a5b9e1264588
---
M src/ve.utils.js
1 file changed, 7 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/30/208330/1

diff --git a/src/ve.utils.js b/src/ve.utils.js
index 017e9fe..c6bc509 100644
--- a/src/ve.utils.js
+++ b/src/ve.utils.js
@@ -46,7 +46,7 @@
 
 /**
  * @method
- * @inheritdoc OO#cloneObject
+ * @inheritdoc OO#getObjectValues
  */
 ve.getObjectValues = OO.getObjectValues;
 
@@ -61,6 +61,12 @@
  * @inheritdoc OO#copy
  */
 ve.copy = OO.copy;
+
+/**
+ * @method
+ * @inheritdoc OO#getObjectValues
+ */
+ve.debounce = OO.ui.debounce;
 
 /**
  * Copy an array of DOM elements, optionally into a different document.
@@ -383,38 +389,6 @@
  */
 ve.dir = ve.dir || function () {
        // don't do anything, this is just a stub
-};
-
-/**
- * Return a function, that, as long as it continues to be invoked, will not
- * be triggered. The function will be called after it stops being called for
- * N milliseconds. If `immediate` is passed, trigger the function on the
- * leading edge, instead of the trailing.
- *
- * Ported from: http://underscorejs.org/underscore.js
- *
- * @param {Function} func
- * @param {number} wait
- * @param {boolean} immediate
- * @returns {Function}
- */
-ve.debounce = function ( func, wait, immediate ) {
-       var timeout;
-       return function () {
-               var context = this,
-                       args = arguments,
-                       later = function () {
-                               timeout = null;
-                               if ( !immediate ) {
-                                       func.apply( context, args );
-                               }
-                       };
-               if ( immediate && !timeout ) {
-                       func.apply( context, args );
-               }
-               clearTimeout( timeout );
-               timeout = setTimeout( later, wait );
-       };
 };
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/208330
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e181acc116e5a4b4c7a271dd559a5b9e1264588
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <roan.katt...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to