luci-base: luci.js: add Object.assign polyfill

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-01-06 16:37:05 +01:00
parent 3a24c2dbaa
commit 53e20c4925

View file

@ -1,4 +1,26 @@
(function(window, document, undefined) { (function(window, document, undefined) {
/* Object.assign polyfill for IE */
if (typeof Object.assign !== 'function') {
Object.defineProperty(Object, 'assign', {
value: function assign(target, varArgs) {
if (target == null)
throw new TypeError('Cannot convert undefined or null to object');
var to = Object(target);
for (var index = 1; index < arguments.length; index++)
if (arguments[index] != null)
for (var nextKey in arguments[index])
if (Object.prototype.hasOwnProperty.call(arguments[index], nextKey))
to[nextKey] = arguments[index][nextKey];
return to;
},
writable: true,
configurable: true
});
}
var modalDiv = null, var modalDiv = null,
tooltipDiv = null, tooltipDiv = null,
tooltipTimeout = null, tooltipTimeout = null,