aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2009-12-28 00:56:25 +0100
committerMatěj Cepl <mcepl@redhat.com>2009-12-28 00:56:25 +0100
commit1a87ce0f7c6799a39e0207c01a50346c84c7a311 (patch)
treed4592b1cc7f769ae81be117165724fea6b525de5
parentc91b962226bd00e59c043d0e398a8db9d050415d (diff)
downloadbugzilla-triage-1a87ce0f7c6799a39e0207c01a50346c84c7a311.tar.gz
Fix selectOption ... there actually IS too much .value replacing .textContent :)
-rw-r--r--bugzillaBugTriage.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js
index 4c23b90..2c6bc7d 100644
--- a/bugzillaBugTriage.js
+++ b/bugzillaBugTriage.js
@@ -881,13 +881,15 @@ BzPage.prototype.parseAttachmentLine = function (inElem) {
BzPage.prototype.selectOption = function(id,label) {
var sel = this.dok.getElementById(id);
var options = Array.filter(sel.getElementsByTagName("option"),
- function (x){ return x.value === label; }
+ function (x){ return x.textContent.trim() == label; }
);
theOption = options.length ? options[0] : [];
- theOption.selected = true;
- var intEvent = this.dok.createEvent("HTMLEvents");
- intEvent.initEvent("change", true, true);
- theOption.dispatchEvent(intEvent);
+ if (theOption) {
+ theOption.selected = true;
+ var intEvent = this.dok.createEvent("HTMLEvents");
+ intEvent.initEvent("change", true, true);
+ theOption.dispatchEvent(intEvent);
+ }
};
/**