diff options
author | Armen Kesablyan | 2012-05-23 14:34:58 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-05-23 14:34:58 -0700 |
commit | c21db7f1e4a0582777bdb5366df5d023a915b779 (patch) | |
tree | c4d29cb4686101d4a480ae836d20187879cf5400 /js/lib/NJUtils.js | |
parent | 3ed95247e9ea4b0a7833401ed6809647b7c4acbf (diff) | |
parent | 1a7e347810401e6262d9d7bad1c3583e6773993b (diff) | |
download | ninja-c21db7f1e4a0582777bdb5366df5d023a915b779.tar.gz |
Merge branch 'refs/heads/dom-architecture' into binding
Conflicts:
js/data/panels-data.js
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/lib/NJUtils.js')
-rwxr-xr-x | js/lib/NJUtils.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index d0f547f5..90aebb84 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js | |||
@@ -19,16 +19,17 @@ exports.NJUtils = Montage.create(Component, { | |||
19 | ///// Quick "getElementById" | 19 | ///// Quick "getElementById" |
20 | $ : { | 20 | $ : { |
21 | value: function(id, doc) { | 21 | value: function(id, doc) { |
22 | var _doc = doc || document; | 22 | doc = doc || document; |
23 | return _doc.getElementById(id); | 23 | return doc.getElementById(id); |
24 | } | 24 | } |
25 | }, | 25 | }, |
26 | 26 | ||
27 | ///// Quick "getElementsByClassName" which also returns as an Array | 27 | ///// Quick "getElementsByClassName" which also returns as an Array |
28 | ///// Can return as NodeList by passing true as second argument | 28 | ///// Can return as NodeList by passing true as second argument |
29 | $$ : { | 29 | $$ : { |
30 | value: function(className, asNodeList) { | 30 | value: function(className, asNodeList, doc) { |
31 | var list = document.getElementsByClassName(className); | 31 | doc = doc || document; |
32 | var list = doc.getElementsByClassName(className); | ||
32 | return (asNodeList) ? list : this.toArray(list); | 33 | return (asNodeList) ? list : this.toArray(list); |
33 | } | 34 | } |
34 | }, | 35 | }, |