From a5ee11857f923d3e49b44c0a8c480e9d0b026d5b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 22 Feb 2012 23:18:12 -0800 Subject: CSS Panel Update --- js/lib/NJUtils.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'js/lib/NJUtils.js') 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, { ///// Quick "getElementById" $ : { - value: function(id) { - return document.getElementById(id); + value: function(id, doc) { + doc = doc || document; + return doc.getElementById(id); } }, ///// Quick "getElementsByClassName" which also returns as an Array ///// Can return as NodeList by passing true as second argument $$ : { - value: function(className, asNodeList) { - var list = document.getElementsByClassName(className); + value: function(className, asNodeList, doc) { + doc = doc || document; + var list = doc.getElementsByClassName(className); return (asNodeList) ? list : this.toArray(list); } }, -- cgit v1.2.3 From fef450f6dd19243f7d6cffb80ba706a67d39e284 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:23:21 -0700 Subject: Fixing reference of document --- js/lib/NJUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/lib/NJUtils.js') diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index 90aebb84..7dd4c9e8 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js @@ -64,7 +64,7 @@ exports.NJUtils = Montage.create(Component, { value: function(tag, attr, doc) { var _doc, el; - _doc = doc ? doc._document : document; + _doc = doc ? doc.model.views.design.document : document; el = _doc.createElement(tag); this.decor(el, attr); -- cgit v1.2.3