diff options
author | Eric Guzman | 2012-02-22 23:18:12 -0800 |
---|---|---|
committer | Eric Guzman | 2012-02-22 23:18:12 -0800 |
commit | a5ee11857f923d3e49b44c0a8c480e9d0b026d5b (patch) | |
tree | 55bb6d0dc2ee710290ac5af0bb46ec66a6b2e381 /js/lib | |
parent | 1c528b42f9b1c9be9197921586388c3a3bdc5c17 (diff) | |
download | ninja-a5ee11857f923d3e49b44c0a8c480e9d0b026d5b.tar.gz |
CSS Panel Update
Diffstat (limited to 'js/lib')
-rwxr-xr-x | js/lib/NJUtils.js | 10 |
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 | }, |