aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jsons/Config_data.json2
-rw-r--r--lib/bzpage.js22
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);
}
};