diff options
author | Matěj Cepl <mcepl@redhat.com> | 2009-12-28 00:56:25 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2009-12-28 00:56:25 +0100 |
commit | 1a87ce0f7c6799a39e0207c01a50346c84c7a311 (patch) | |
tree | d4592b1cc7f769ae81be117165724fea6b525de5 | |
parent | c91b962226bd00e59c043d0e398a8db9d050415d (diff) | |
download | bugzilla-triage-1a87ce0f7c6799a39e0207c01a50346c84c7a311.tar.gz |
Fix selectOption ... there actually IS too much .value replacing .textContent :)
-rw-r--r-- | bugzillaBugTriage.js | 12 |
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); + } }; /** |