From 72c336d7d8b05058c8285c72d9888901bfc7373c Mon Sep 17 00:00:00 2001 From: Tobias Reinwarth Date: Tue, 5 Mar 2019 13:58:16 +0100 Subject: [PATCH] Fix for browsers without ES6 support (#64) * Fix for older browsers without ES6 support --- muk_web_utils/static/src/js/underscore.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/muk_web_utils/static/src/js/underscore.js b/muk_web_utils/static/src/js/underscore.js index f791c51..5901f96 100644 --- a/muk_web_utils/static/src/js/underscore.js +++ b/muk_web_utils/static/src/js/underscore.js @@ -18,7 +18,9 @@ **********************************************************************************/ _.mixin({ - memoizeDebounce: function(func, wait=0, options={}) { + memoizeDebounce: function(func, wait, options) { + wait = (typeof wait !== 'undefined') ? wait : 0; + options = (typeof options !== 'undefined') ? options : {}; var mem = _.memoize(function() { return _.debounce(func, wait, options) }, options.resolver); @@ -29,7 +31,9 @@ _.mixin({ }); _.mixin({ - memoizeThrottle: function(func, wait=0, options={}) { + memoizeThrottle: function(func, wait, options) { + wait = (typeof wait !== 'undefined') ? wait : 0; + options = (typeof options !== 'undefined') ? options : {}; var mem = _.memoize(function() { return _.throttle(func, wait, options) }, options.resolver);