From edb0a8716980e814e04464612512765ddc2b79b4 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Mon, 16 Aug 2010 14:05:32 -0400 Subject: Catch up with changes in new RH bugzilla - also add a diagnostics for future use. --- jsons/Config_data.json | 2 +- lib/bzpage.js | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/jsons/Config_data.json b/jsons/Config_data.json index b5f225b..b593281 100644 --- a/jsons/Config_data.json +++ b/jsons/Config_data.json @@ -2,7 +2,7 @@ "commentPackages": { "rh-common": { "markTriaged": { - "position": "-commit_middle", + "position": "-commit_top", "name": "Mark Triaged", "markTriaged": true, "assignee": null diff --git a/lib/bzpage.js b/lib/bzpage.js index 878ce87..f0b4242 100644 --- a/lib/bzpage.js +++ b/lib/bzpage.js @@ -419,15 +419,19 @@ BZPage.prototype.createNewButton = function createNewButton (location, after, pk var originalLocation = this.doc.getElementById(location); - if (after) { - originalLocation.parentNode.insertBefore(newButton, - originalLocation.nextSibling); - originalLocation.parentNode.insertBefore(this.doc - .createTextNode("\u00A0"), newButton); - } else { - originalLocation.parentNode.insertBefore(newButton, originalLocation); - originalLocation.parentNode.insertBefore(this.doc - .createTextNode("\u00A0"), originalLocation); + try { + if (after) { + originalLocation.parentNode.insertBefore(newButton, + originalLocation.nextSibling); + originalLocation.parentNode.insertBefore(this.doc + .createTextNode("\u00A0"), newButton); + } else { + originalLocation.parentNode.insertBefore(newButton, originalLocation); + originalLocation.parentNode.insertBefore(this.doc + .createTextNode("\u00A0"), originalLocation); + } + } catch (e if e instanceof TypeError) { + console.log("cannot find originalLocation element with id " + location); } }; -- cgit