elem.style.left = elem.parentNode.clientWidth / 2 - parseInt(elem.clientWidth) / 2 + "px";
}
static centerVertical(elem){
- elem.style.top = elem.parentNode.clientHeight / 2 - parseInt(elem.clientHeight) / 2 + "px";
+ let parent = elem.parentNode;
+ if (parent == document.body)
+ parent = document.documentElement;
+ elem.style.top = parent.clientHeight / 2 - parseInt(elem.clientHeight) / 2 + "px";
}
static remove(elem){
if(elem)
static humanFormat(str){
var str = str.replace("_", " ");
str = str[0].toUpperCase() + str.slice(1, str.length);
- return str;
+ return str;
}
static copy(dest, src){
for(let prop in src){
if(obj[prop] === search)
obj[prop] = replace;
else if(obj[prop] instanceof Object)
- obj[prop] = this.replaceRecursive(obj[prop], search, replace);
+ obj[prop] = this.replaceRecursive(obj[prop], search, replace);
}
return obj;
}