Fixed errors in IE

This commit is contained in:
Kasper Rynning-Tønnesen
2015-06-17 17:56:51 +02:00
parent 6bab2b7603
commit 74f2a3d62a
2 changed files with 12 additions and 1 deletions

View File

@@ -295,6 +295,16 @@ function notifyUser(id, title) {
}
}
Element.prototype.remove = function() {
this.parentElement.removeChild(this);
}
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
for(var i = 0, len = this.length; i < len; i++) {
if(this[i] && this[i].parentElement) {
this[i].parentElement.removeChild(this[i]);
}
}
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;