Merge "StringUtils: Add a utility for checking if a string is a valid regex"
[lhc/web/wiklou.git] / resources / src / mediawiki.htmlform.checker.js
index 33207d4..473635a 100644 (file)
@@ -3,14 +3,6 @@
        // FIXME: mw.htmlform.Element also sets this to empty object
        mw.htmlform = {};
 
-       function debounce( delay, callback ) {
-               var timeout;
-               return function () {
-                       clearTimeout( timeout );
-                       timeout = setTimeout( Function.prototype.apply.bind( callback, this, arguments ), delay );
-               };
-       }
-
        /**
         * @class mw.htmlform.Checker
         */
@@ -60,7 +52,7 @@
                if ( $extraElements ) {
                        $e = $e.add( $extraElements );
                }
-               $e.on( events, debounce( 1000, this.validate.bind( this ) ) );
+               $e.on( events, mw.util.debounce( 1000, this.validate.bind( this ) ) );
 
                return this;
        };