mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
adds polyfill for Object.assign, fix for IE11
This commit is contained in:
parent
37f7642ead
commit
2f4dd4642a
@ -13,6 +13,7 @@
|
|||||||
//= require jquery
|
//= require jquery
|
||||||
//= require jquery_ujs
|
//= require jquery_ujs
|
||||||
//= require bootstrap
|
//= require bootstrap
|
||||||
|
//= require polyfill
|
||||||
//= require jquery-ui/ui/jquery.ui.core
|
//= require jquery-ui/ui/jquery.ui.core
|
||||||
//= require jquery-ui/ui/jquery.ui.widget
|
//= require jquery-ui/ui/jquery.ui.widget
|
||||||
//= require jquery-ui/ui/jquery.ui.mouse
|
//= require jquery-ui/ui/jquery.ui.mouse
|
||||||
|
29
lib/assets/javascripts/polyfill.js
Normal file
29
lib/assets/javascripts/polyfill.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
if (typeof Object.assign != 'function') {
|
||||||
|
// Must be writable: true, enumerable: false, configurable: true
|
||||||
|
Object.defineProperty(Object, "assign", {
|
||||||
|
value: function assign(target, varArgs) { // .length of function is 2
|
||||||
|
'use strict';
|
||||||
|
if (target == null) { // TypeError if undefined or null
|
||||||
|
throw new TypeError('Cannot convert undefined or null to object');
|
||||||
|
}
|
||||||
|
|
||||||
|
var to = Object(target);
|
||||||
|
|
||||||
|
for (var index = 1; index < arguments.length; index++) {
|
||||||
|
var nextSource = arguments[index];
|
||||||
|
|
||||||
|
if (nextSource != null) { // Skip over if undefined or null
|
||||||
|
for (var nextKey in nextSource) {
|
||||||
|
// Avoid bugs when hasOwnProperty is shadowed
|
||||||
|
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
||||||
|
to[nextKey] = nextSource[nextKey];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
},
|
||||||
|
writable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user