summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/web/js
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2015-02-04 16:50:59 +0100
committerDavid Lawrence <dkl@mozilla.com>2015-02-04 16:50:59 +0100
commit06242167fc94c0b43ba497510d46477339b91267 (patch)
tree3739d02430f7994b1b07947ac8d1f1e9c6122d1c /extensions/BMO/web/js
parent95aac54ca88a8d7f5df3ae1b62db810e33897e86 (diff)
downloadbugzilla-06242167fc94c0b43ba497510d46477339b91267.tar.gz
bugzilla-06242167fc94c0b43ba497510d46477339b91267.tar.xz
Bug 1128969: 'Clone this bug' redirects to product selection instead of displaying context menu
Diffstat (limited to 'extensions/BMO/web/js')
-rw-r--r--extensions/BMO/web/js/edit_bug.js42
1 files changed, 24 insertions, 18 deletions
diff --git a/extensions/BMO/web/js/edit_bug.js b/extensions/BMO/web/js/edit_bug.js
index 41a71935e..87cbbba21 100644
--- a/extensions/BMO/web/js/edit_bug.js
+++ b/extensions/BMO/web/js/edit_bug.js
@@ -5,24 +5,30 @@
* This Source Code Form is "Incompatible With Secondary Licenses", as
* defined by the Mozilla Public License, v. 2.0. */
-function init_clone_bug_menu(el, bug_id, product, component) {
- var diff_url = 'enter_bug.cgi?format=__default__&cloned_bug_id=' + bug_id;
- var cur_url = diff_url +
- '&product=' + encodeURIComponent(product) +
- '&component=' + encodeURIComponent(component);
- var menu = new YAHOO.widget.Menu('clone_bug_menu', { position : 'dynamic' });
- menu.addItems([
- { text: 'Clone to the current product', url: cur_url },
- { text: 'Clone to a different product', url: diff_url }
- ]);
- menu.render(document.body);
- YAHOO.util.Event.addListener(el, 'click', show_clone_bug_menu, menu);
-}
-
-function show_clone_bug_menu(event, menu) {
- menu.cfg.setProperty('xy', YAHOO.util.Event.getXY(event));
- menu.show();
- event.preventDefault();
+function show_clone_menu(el, bug_id, product, component) {
+ var base_url = 'enter_bug.cgi?format=__default__&cloned_bug_id=' + bug_id;
+ var items = {
+ curr_prod : {
+ name: 'Clone to the current product',
+ callback: function () {
+ var curr_url = base_url +
+ '&product=' + encodeURIComponent(product) +
+ '&component=' + encodeURIComponent(component);
+ window.open(curr_url, '_blank');
+ }
+ },
+ diff_prod: {
+ name: 'Clone to a new product',
+ callback: function () {
+ window.open(base_url, '_blank');
+ }
+ }
+ };
+ $.contextMenu({
+ selector: '#' + el.id,
+ trigger: 'left',
+ items: items
+ });
}
// -- make attachment table, comments, new comment textarea equal widths