aboutsummaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-02-22 11:09:06 +0100
committerMatěj Cepl <mcepl@redhat.com>2011-02-22 11:09:06 +0100
commitfd3fe0f06944d4462e68c7ea8887e7b3b1f6bc04 (patch)
treec4e56dd8bdf273a863b427028f636a3f5442efea /data
parent683cd625674941520da17e2c34ebfc164d3308a8 (diff)
downloadbugzilla-triage-fd3fe0f06944d4462e68c7ea8887e7b3b1f6bc04.tar.gz
Fill in magic finally really works.
Diffstat (limited to 'data')
-rw-r--r--data/rhbzpage.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/data/rhbzpage.js b/data/rhbzpage.js
index 061f9ed..b45d9e2 100644
--- a/data/rhbzpage.js
+++ b/data/rhbzpage.js
@@ -548,11 +548,20 @@ function fillInWhiteBoard(PCIidArr) {
var outStr = "";
var cardIDStr = "";
var cardIDArr = [];
- var PCIid = PCIidArr[0] + "," + PCIidArr[1];
-
- var cardName = constantData.chipNames[PCIid][0].toUpperCase();
- var titleElem = document.getElementById('short_desc_nonedit_display');
- titleElem.textContent = '[' + cardName + ']\u00A0' + titleElem.textContent;
+ var cardName = "";
+ var PCIid = (PCIidArr[0] + "," + PCIidArr[1]).toUpperCase();
+
+ try {
+ cardName = constantData.chipNames[PCIid][0];
+ } catch (e if e instanceof TypeError) {
+ alert("PCI ID " + PCIid + " is not known!");
+ return ; // early termination
+ } catch (e) {
+ throw e;
+ }
+ clickMouse("editme_action");
+ var titleElem = document.getElementById('short_desc');
+ titleElem.value = '[' + cardName + ']\u00A0' + titleElem.value;
document.getElementById("fillin_btn").style.display = "none";
}