From 7a58ad7cb1264f8e6769a196b1a9439f6c7a6ded Mon Sep 17 00:00:00 2001 From: Christoph Dorn Date: Tue, 3 Sep 2013 15:14:39 -0700 Subject: [PATCH] backwards compatible node selection --- extension/chrome/content/lib/reps.js | 34 ++++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/extension/chrome/content/lib/reps.js b/extension/chrome/content/lib/reps.js index 4a619f7..eadfbef 100644 --- a/extension/chrome/content/lib/reps.js +++ b/extension/chrome/content/lib/reps.js @@ -586,13 +586,16 @@ function(WINDOW, DOMPLATE, DOM, CSS, EVENTS) CSS.toggleClass(logRow, "opened"); if (CSS.hasClass(logRow, "opened")) { - - /* Lets only render the stack trace once we request it */ - if (!DOM.getChildByClass(logRow.firstChild.firstChild, "head", "info")) { - this.infoTag.append({ - 'object': DOM.getChildByClass(logRow.firstChild.firstChild, "head").repObject - }, DOM.getChildByClass(logRow.firstChild.firstChild, "head")); - } + + var head = logRow.getElementsByClassName("head")[0]; + if (head) { + /* Lets only render the stack trace once we request it */ + if (!head.getElementsByClassName("info")[0]) { + this.infoTag.append({ + 'object': head.repObject + }, head); + } + } } } }, @@ -769,14 +772,15 @@ function(WINDOW, DOMPLATE, DOM, CSS, EVENTS) if (CSS.hasClass(logRow, "opened")) { - - /* Lets only render the stack trace once we request it */ - if (!DOM.getChildByClass(logRow.firstChild.firstChild, "head", "info")) - { - this.infoTag.append({'object':DOM.getChildByClass(logRow.firstChild.firstChild, "head").repObject, - 'meta':DOM.getChildByClass(logRow.firstChild.firstChild, "head").repMeta}, - DOM.getChildByClass(logRow.firstChild.firstChild, "head")); - } + var head = logRow.getElementsByClassName("head")[0]; + if (head) { + /* Lets only render the stack trace once we request it */ + if (!head.getElementsByClassName("info")[0]) { + this.infoTag.append({'object':head.repObject, + 'meta':head.repMeta}, + head); + } + } } } },