forked from eurodatacube/LPvis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.js
25 lines (24 loc) · 768 Bytes
/
utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function arraysEqualityCheck(a, b) {
if (a === b) return true;
if (a == null || b == null) return false;
if (a.length != b.length) return false;
// we care about item order
for (var i = 0; i < a.length; ++i) {
if (a[i] !== b[i]) return false;
}
return true;
}
function getStyleGlobal(className_) {
// returns style object of first style specification that entirely matches the className_ selector
var styleSheets = document.styleSheets;
for(var i = 0; i < document.styleSheets.length; i++){
var classes = styleSheets[i].rules || styleSheets[i].cssRules;
if (!classes)
continue;
for (var x = 0; x < classes.length; x++) {
if (classes[x].selectorText == className_) {
return classes[x].style;
}
}
}
}