aboutsummaryrefslogtreecommitdiff
path: root/js/lib/NJUtils.js
diff options
context:
space:
mode:
authorEric Guzman2012-02-22 23:18:12 -0800
committerEric Guzman2012-02-22 23:18:12 -0800
commita5ee11857f923d3e49b44c0a8c480e9d0b026d5b (patch)
tree55bb6d0dc2ee710290ac5af0bb46ec66a6b2e381 /js/lib/NJUtils.js
parent1c528b42f9b1c9be9197921586388c3a3bdc5c17 (diff)
downloadninja-a5ee11857f923d3e49b44c0a8c480e9d0b026d5b.tar.gz
CSS Panel Update
Diffstat (limited to 'js/lib/NJUtils.js')
-rwxr-xr-xjs/lib/NJUtils.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js
index 887743c5..49dfd706 100755
--- a/js/lib/NJUtils.js
+++ b/js/lib/NJUtils.js
@@ -19,16 +19,18 @@ exports.NJUtils = Object.create(Object.prototype, {
19 19
20 ///// Quick "getElementById" 20 ///// Quick "getElementById"
21 $ : { 21 $ : {
22 value: function(id) { 22 value: function(id, doc) {
23 return document.getElementById(id); 23 doc = doc || document;
24 return doc.getElementById(id);
24 } 25 }
25 }, 26 },
26 27
27 ///// Quick "getElementsByClassName" which also returns as an Array 28 ///// Quick "getElementsByClassName" which also returns as an Array
28 ///// Can return as NodeList by passing true as second argument 29 ///// Can return as NodeList by passing true as second argument
29 $$ : { 30 $$ : {
30 value: function(className, asNodeList) { 31 value: function(className, asNodeList, doc) {
31 var list = document.getElementsByClassName(className); 32 doc = doc || document;
33 var list = doc.getElementsByClassName(className);
32 return (asNodeList) ? list : this.toArray(list); 34 return (asNodeList) ? list : this.toArray(list);
33 } 35 }
34 }, 36 },