From 3ac701266452d3509776fe58f9e1b2b8e9f33c1e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 24 Mar 2015 13:45:44 +0800 Subject: Bug 1096798: prototype modal show_bug view --- extensions/BMO/web/js/edituser_menu.js | 75 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 38 deletions(-) (limited to 'extensions/BMO') diff --git a/extensions/BMO/web/js/edituser_menu.js b/extensions/BMO/web/js/edituser_menu.js index 85d933220..707e35b6e 100644 --- a/extensions/BMO/web/js/edituser_menu.js +++ b/extensions/BMO/web/js/edituser_menu.js @@ -6,43 +6,42 @@ * defined by the Mozilla Public License, v. 2.0. */ function show_usermenu(id, email, show_edit) { - var items = { - profile: { - name: "Profile", - callback: function () { - var href = "user_profile?login=" + encodeURIComponent(email); - window.open(href, "_blank"); - } - }, - activity: { - name: "Activity", - callback: function () { - var href = "page.cgi?id=user_activity.html&action=run&from=-14d&who=" - + encodeURIComponent(email); - window.open(href, "_blank"); - } - }, - mail: { - name: "Mail", - callback: function () { - var href = "mailto:" + encodeURIComponent(email); - window.open(href, "_blank"); - } - }, - }; - if (show_edit) { - items.edit = { - name: "Edit", - callback: function () { - var href = "editusers.cgi?action=edit&userid=" + id; - window.open(href, "_blank"); - } - }; - } - $.contextMenu({ - selector: ".vcard_" + id, - trigger: "left", - items: items - }); + var items = [ + { + name: "Profile", + callback: function () { + var href = "user_profile?login=" + encodeURIComponent(email); + window.open(href, "_blank"); + } + }, + { + name: "Activity", + callback: function () { + var href = "page.cgi?id=user_activity.html&action=run&from=-14d&who=" + encodeURIComponent(email); + window.open(href, "_blank"); + } + }, + { + name: "Mail", + callback: function () { + var href = "mailto:" + encodeURIComponent(email); + window.open(href, "_blank"); + } + } + ]; + if (show_edit) { + items.push({ + name: "Edit", + callback: function () { + var href = "editusers.cgi?action=edit&userid=" + id; + window.open(href, "_blank"); + } + }); + } + $.contextMenu({ + selector: ".vcard_" + id, + trigger: "left", + items: items + }); } -- cgit v1.2.3-24-g4f1b