Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
* Element.remove() fix for internet explorer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eser Ozvataf committed Nov 22, 2014
1 parent 1780871 commit 13c5f57
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
15 changes: 13 additions & 2 deletions dist/laroux.js
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,9 @@
while (temp.firstChild) {
frag.appendChild(temp.firstChild);
}
temp.remove();

// nulling out the reference, there is no obvious dispose method
temp = null;

return frag;
},
Expand Down Expand Up @@ -1233,7 +1235,7 @@

clear: function(element) {
while (element.hasChildNodes()) {
element.firstChild.remove();
element.removeChild(element.firstChild);
}
},

Expand Down Expand Up @@ -1361,6 +1363,15 @@
}*/
};

// a fix for Internet Explorer
if (typeof Element.prototype.remove == 'undefined') {
Element.prototype.remove = function() {
if (this.parentElement !== null) {
this.parentElement.removeChild(this);
}
};
}

})(this.laroux);
;(function(laroux) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion dist/laroux.mimic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 13c5f57

Please sign in to comment.