/* * js-throttle-debounce v0.1.1 * https://github.com/emn178/js-throttle-debounce * * Copyright 2015, emn178@gmail.com * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ (function(l,b){Function.prototype.throttle=function(a,e){var c=this,f=0,d;a===b&&(a=100);return function(){var b=this,k=arguments,g=function(){f=new Date;c.apply(b,k)};d&&(clearTimeout(d),d=null);var h=new Date-f;h>a?g():e||(d=setTimeout(g,a-h))}};Function.prototype.debounce=function(a){var e=this,c;a===b&&(a=100);return function(){var b=this,d=arguments;c&&(clearTimeout(c),c=null);c=setTimeout(function(){e.apply(b,d)},a)}}})(this);