0

Fix for IE11

This commit is contained in:
Andrew Chin
2016-12-10 17:56:12 -05:00
parent 806ad92b6f
commit 5047655bb7

View File

@@ -33,6 +33,8 @@ overviewer.util = {
*/
'initialize': function() {
//overviewer.util.initializeClassPrototypes();
overviewer.util.initializePolyfills();
document.getElementById('NoJSWarning').remove();
@@ -222,6 +224,21 @@ overviewer.util = {
},
/** Any polyfills needed to improve browser compatibility
*/
'initializePolyfills': function() {
// From https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove
// IE is missing this
if (!('remove' in Element.prototype)) {
Element.prototype.remove = function() {
if (this.parentNode) {
this.parentNode.removeChild(this);
}
};
}
},
/**
* This adds some methods to these classes because Javascript is stupid