From 429e456b7d66d2eef0832c193a9c7e7b8a568766 Mon Sep 17 00:00:00 2001 From: jcohen Date: Tue, 25 Oct 2016 15:49:48 +0200 Subject: [PATCH] Fix the $.debounce parameters not beeing resolved correctly and adapt minified file (compressed with https://javascript-minifier.com/) --- jquery.ba-throttle-debounce.js | 4 ++-- jquery.ba-throttle-debounce.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.ba-throttle-debounce.js b/jquery.ba-throttle-debounce.js index fa30bdf..61a77dc 100644 --- a/jquery.ba-throttle-debounce.js +++ b/jquery.ba-throttle-debounce.js @@ -245,8 +245,8 @@ $.debounce = function( delay, at_begin, callback ) { return callback === undefined - ? jq_throttle( delay, at_begin, false ) - : jq_throttle( delay, callback, at_begin !== false ); + ? jq_throttle(delay, false, at_begin, true) + : jq_throttle(delay, at_begin !== false, callback, true); }; })(this); diff --git a/jquery.ba-throttle-debounce.min.js b/jquery.ba-throttle-debounce.min.js index 0720550..c69fe38 100644 --- a/jquery.ba-throttle-debounce.min.js +++ b/jquery.ba-throttle-debounce.min.js @@ -6,4 +6,4 @@ * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ -(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); \ No newline at end of file +!function(n,t){"$:nomunge";var u,e=n.jQuery||n.Cowboy||(n.Cowboy={});e.throttle=u=function(n,u,o,i){function r(){function e(){c=+new Date,o.apply(f,d)}function r(){a=t}var f=this,g=+new Date-c,d=arguments;i&&!a&&e(),a&&clearTimeout(a),i===t&&g>n?e():u!==!0&&(a=setTimeout(i?r:e,i===t?n-g:n))}var a,c=0;return"boolean"!=typeof u&&(i=o,o=u,u=t),e.guid&&(r.guid=o.guid=o.guid||e.guid++),r},e.debounce=function(n,e,o){return o===t?u(n,!1,e,!0):u(n,e!==!1,o,!0)}}(this);