diff options
author | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2012-08-14 05:23:57 -0400 |
---|---|---|
committer | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2012-08-14 05:23:57 -0400 |
commit | 54c6a04b722663b518bf99b4d98a1c2e86ee5103 (patch) | |
tree | 91cc311d76bcdd0c6fb053798b383fbeb44c4063 /templates/project/assets/javascripts/gridster/utils.js | |
parent | 8e3ca1d64444408677c93721c198908de43fa417 (diff) |
Updated the sample project.
Diffstat (limited to 'templates/project/assets/javascripts/gridster/utils.js')
-rwxr-xr-x | templates/project/assets/javascripts/gridster/utils.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/templates/project/assets/javascripts/gridster/utils.js b/templates/project/assets/javascripts/gridster/utils.js deleted file mode 100755 index 5f340b3..0000000 --- a/templates/project/assets/javascripts/gridster/utils.js +++ /dev/null @@ -1,41 +0,0 @@ -;(function(window, undefined) { - /* Debounce and throttle functions taken from underscore.js */ - window.debounce = function(func, wait, immediate) { - var timeout; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - if (immediate && !timeout) func.apply(context, args); - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; - }; - - - window.throttle = function(func, wait) { - var context, args, timeout, throttling, more, result; - var whenDone = debounce( - function(){ more = throttling = false; }, wait); - return function() { - context = this; args = arguments; - var later = function() { - timeout = null; - if (more) func.apply(context, args); - whenDone(); - }; - if (!timeout) timeout = setTimeout(later, wait); - if (throttling) { - more = true; - } else { - result = func.apply(context, args); - } - whenDone(); - throttling = true; - return result; - }; - }; - -})(window); |