diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2012-06-05 17:08:14 +0200 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2012-06-05 17:08:14 +0200 |
commit | 1079586051beb43e6a09914b0678f02942aa62b0 (patch) | |
tree | 3e71d2f92c3bff365a189f154f14c95804ed9951 /extensions | |
parent | 5c3118bb95f1d5ac0a4d695794c126e310c51bc3 (diff) | |
download | bugzilla-1079586051beb43e6a09914b0678f02942aa62b0.tar.gz bugzilla-1079586051beb43e6a09914b0678f02942aa62b0.tar.xz |
Bug 759655 - pressing return to select a component from the product/component search doesn't work
r=glob
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/BMO/web/js/choose_product.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/extensions/BMO/web/js/choose_product.js b/extensions/BMO/web/js/choose_product.js index 6fe980971..31d3ee224 100644 --- a/extensions/BMO/web/js/choose_product.js +++ b/extensions/BMO/web/js/choose_product.js @@ -25,14 +25,8 @@ YAHOO.bugzilla.prodCompSearch = { return YAHOO.lang.JSON.stringify(json_object); }, resultListFormat : function(oResultData, enteredText, sResultMatch) { - var url = "enter_bug.cgi?product=" + encodeURIComponent(oResultData[0]) + - "&component=" + encodeURIComponent(oResultData[1]); - if (YAHOO.bugzilla.prodCompSearch.format) { - url = url + "&format=" + encodeURIComponent(YAHOO.bugzilla.prodCompSearch.format); - } - return ("<a href=\"" + url + "\"><b>" + - _escapeHTML(oResultData[0]) + "</b> :: " + - _escapeHTML(oResultData[1]) + "</a>"); + return YAHOO.lang.escapeHTML(oResultData[0]) + " :: " + + YAHOO.lang.escapeHTML(oResultData[1]); }, init_ds : function(){ this.dataSource = new YAHOO.util.XHRDataSource("jsonrpc.cgi"); @@ -71,5 +65,15 @@ YAHOO.bugzilla.prodCompSearch = { this.sendQuery(input.value); } }); + this.autoComplete.itemSelectEvent.subscribe(function (e, args) { + var oData = args[2]; + var url = "enter_bug.cgi?product=" + encodeURIComponent(oData[0]) + + "&component=" + encodeURIComponent(oData[1]); + var format = YAHOO.bugzilla.prodCompSearch.format; + if (format) { + url += "&format=" + encodeURIComponent(format); + } + window.location.href = url; + }); } } |