diff options
Diffstat (limited to 'addons/web/static/src/js/core/misc.js')
| -rw-r--r-- | addons/web/static/src/js/core/misc.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/addons/web/static/src/js/core/misc.js b/addons/web/static/src/js/core/misc.js index 64ebeeb1794..983b26d3606 100644 --- a/addons/web/static/src/js/core/misc.js +++ b/addons/web/static/src/js/core/misc.js @@ -173,6 +173,23 @@ function ReloadContext (parent, action) { } core.action_registry.add("reload_context", ReloadContext); +// In Internet Explorer, document doesn't have the contains method, so we make a +// polyfill for the method in order to be compatible. +if (!document.contains) { + document.contains = function contains (node) { + if (!(0 in arguments)) { + throw new TypeError('1 argument is required'); + } + + do { + if (this === node) { + return true; + } + } while (node = node && node.parentNode); + + return false; + }; +} return { blockUI: blockUI, |
