1
Fork 0
This commit is contained in:
Guillaume Gomez 2018-12-02 01:22:44 +01:00
parent 34e31830c0
commit a68988719c
2 changed files with 46 additions and 65 deletions

View file

@ -19,10 +19,7 @@ var mainTheme = document.getElementById("mainThemeStyle");
var savedHref = [];
function hasClass(elem, className) {
if (!elem || !elem.classList) {
return false;
}
return elem.classList.contains(className);
return elem && elem.classList && elem.classList.contains(className);
}
function addClass(elem, className) {
@ -40,12 +37,9 @@ function removeClass(elem, className) {
}
function isHidden(elem) {
return (elem.offsetParent === null);
return elem.offsetParent === null;
}
var allcallers = {};
var resourcesSuffix="";
function onEach(arr, func, reversed) {
if (arr && arr.length > 0 && func) {
var length = arr.length;
@ -66,6 +60,13 @@ function onEach(arr, func, reversed) {
return false;
}
function onEachLazy(lazyArray, func, reversed) {
return onEach(
Array.prototype.slice.call(lazyArray),
func,
reversed);
}
function usableLocalStorage() {
// Check if the browser supports localStorage at all:
if (typeof(Storage) === "undefined") {