From 1079586051beb43e6a09914b0678f02942aa62b0 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Tue, 5 Jun 2012 11:08:14 -0400 Subject: Bug 759655 - pressing return to select a component from the product/component search doesn't work r=glob --- extensions/BMO/web/js/choose_product.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'extensions') 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 ("" + - _escapeHTML(oResultData[0]) + " :: " + - _escapeHTML(oResultData[1]) + ""); + 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; + }); } } -- cgit v1.2.3-24-g4f1b