aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bzpage.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-08-16 14:05:32 -0400
committerMatěj Cepl <mcepl@redhat.com>2010-08-16 14:05:32 -0400
commitedb0a8716980e814e04464612512765ddc2b79b4 (patch)
tree1d6d8c63e20197979e8584d2dda49483f0f10354 /lib/bzpage.js
parentff3ee8ca4f8ea9f30655c714d2fe91b3c43cd0a8 (diff)
downloadbugzilla-triage-edb0a8716980e814e04464612512765ddc2b79b4.tar.gz
Catch up with changes in new RH bugzilla
- also add a diagnostics for future use.
Diffstat (limited to 'lib/bzpage.js')
-rw-r--r--lib/bzpage.js22
1 files changed, 13 insertions, 9 deletions
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);
}
};