summaryrefslogtreecommitdiffstats
path: root/extensions/BMO
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-06-05 17:08:14 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-06-05 17:08:14 +0200
commit1079586051beb43e6a09914b0678f02942aa62b0 (patch)
tree3e71d2f92c3bff365a189f154f14c95804ed9951 /extensions/BMO
parent5c3118bb95f1d5ac0a4d695794c126e310c51bc3 (diff)
downloadbugzilla-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/BMO')
-rw-r--r--extensions/BMO/web/js/choose_product.js20
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;
+ });
}
}