summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/web
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2011-11-14 07:25:01 +0100
committerByron Jones <bjones@mozilla.com>2011-11-14 07:25:01 +0100
commit75e7b3e3aa50b896640e849fc5531a7db5d61f71 (patch)
tree4e9ad4ce4a1ef1559a3d71bd1df74965e86c9ba3 /extensions/BMO/web
parent9cadb22315af5999004c901a8b499d95bed76743 (diff)
downloadbugzilla-75e7b3e3aa50b896640e849fc5531a7db5d61f71.tar.gz
bugzilla-75e7b3e3aa50b896640e849fc5531a7db5d61f71.tar.xz
Bug 450348: add a menu to clone to allow cloning into the same component
Diffstat (limited to 'extensions/BMO/web')
-rw-r--r--extensions/BMO/web/js/edit_bug.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/extensions/BMO/web/js/edit_bug.js b/extensions/BMO/web/js/edit_bug.js
index 5fc2ab6f7..e630eb995 100644
--- a/extensions/BMO/web/js/edit_bug.js
+++ b/extensions/BMO/web/js/edit_bug.js
@@ -55,6 +55,26 @@ function bmo_show_tracking_flags() {
}
}
+function init_clone_bug_menu(el, bug_id, product, component) {
+ var diff_url = 'enter_bug.cgi?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();
+}
+
// -- make attachment table, comments, new comment textarea equal widths
YAHOO.util.Event.onDOMReady(function() {