Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / source / util / DelayedTask.js
diff --git a/source/util/DelayedTask.js b/source/util/DelayedTask.js
deleted file mode 100644 (file)
index 82fbd5d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.util.DelayedTask\r
- * Provides a convenient method of performing setTimeout where a new\r
- * timeout cancels the old timeout. An example would be performing validation on a keypress.\r
- * You can use this class to buffer\r
- * the keypress events for a certain number of milliseconds, and perform only if they stop\r
- * for that amount of time.\r
- * @constructor The parameters to this constructor serve as defaults and are not required.\r
- * @param {Function} fn (optional) The default function to timeout\r
- * @param {Object} scope (optional) The default scope of that timeout\r
- * @param {Array} args (optional) The default Array of arguments\r
- */\r
-Ext.util.DelayedTask = function(fn, scope, args){\r
-    var id = null, d, t;\r
-\r
-    var call = function(){\r
-        var now = new Date().getTime();\r
-        if(now - t >= d){\r
-            clearInterval(id);\r
-            id = null;\r
-            fn.apply(scope, args || []);\r
-        }\r
-    };\r
-    /**\r
-     * Cancels any pending timeout and queues a new one\r
-     * @param {Number} delay The milliseconds to delay\r
-     * @param {Function} newFn (optional) Overrides function passed to constructor\r
-     * @param {Object} newScope (optional) Overrides scope passed to constructor\r
-     * @param {Array} newArgs (optional) Overrides args passed to constructor\r
-     */\r
-    this.delay = function(delay, newFn, newScope, newArgs){\r
-        if(id && delay != d){\r
-            this.cancel();\r
-        }\r
-        d = delay;\r
-        t = new Date().getTime();\r
-        fn = newFn || fn;\r
-        scope = newScope || scope;\r
-        args = newArgs || args;\r
-        if(!id){\r
-            id = setInterval(call, d);\r
-        }\r
-    };\r
-\r
-    /**\r
-     * Cancel the last queued timeout\r
-     */\r
-    this.cancel = function(){\r
-        if(id){\r
-            clearInterval(id);\r
-            id = null;\r
-        }\r
-    };\r
-};
\ No newline at end of file