muk-it / muk_web

MuK Odoo Web Modules
GNU Lesser General Public License v3.0
109 stars 231 forks source link

[11.0][muk_web] IE javascript compatibility #117

Closed MathAndrews closed 5 years ago

MathAndrews commented 5 years ago

Hi,

I use muk_web_utils but in IE11 I have a issue with the file muk_web_utils/static/src/js/underscore.js where you use function default parameters. Sadly it's not supported by IE: MDN web docs - Default parameters

What is your web navigator support policy?

I change the underscore.js file like in the example of the MDN web docs as follow:


_.mixin({
    memoizeDebounce: function (func, wait, options) {
        switch (arguments.length) {
            case 0:
                func;
            case 1:
                wait = 0;
            case 2:
                options = {};
            default:
        }
        var mem = _.memoize(function () {
            return _.debounce(func, wait, options)
        }, options.resolver);
        return function () {
            mem.apply(this, arguments).apply(this, arguments)
        }
    }
});

_.mixin({
    memoizeThrottle: function (func, wait, options) {
        switch (arguments.length) {
            case 0:
                func;
            case 1:
                wait = 0;
            case 2:
                options = {};
            default:
        }
        var mem = _.memoize(function () {
            return _.throttle(func, wait, options)
        }, options.resolver);
        return function () {
            mem.apply(this, arguments).apply(this, arguments)
        }
    }
});

_.mixin({
    memoizeThrottle: function(func, wait, options) {
        switch (arguments.length) {
            case 0:
                func;
            case 1:
                wait = 0;
            case 2:
                options = {};
            default:
        }
        var mem = _.memoize(function() {
            return _.throttle(func, wait, options)
        }, options.resolver);
        return function() {
            mem.apply(this, arguments).apply(this, arguments)
        }
    }
});```
keshrath commented 5 years ago

https://github.com/muk-it/muk_web/commit/dbdffde15201920fa95b49adea57bb375e7c6f62

MathAndrews commented 5 years ago

Great,

Thanks.

MathAndrews commented 4 years ago

Hi,

I just notify that there are two "undescore" (__.mixin({) on line 20 of the file muk_web/muk_web_utils/static/src/js/underscore.js.

It should be _.mixin({

best regards