Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/command/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ define(function (require, exports, module) {
*/
function Menu(id) {
this.id = id;
// Submenus inherit their owner's namespace even though they render as context menus.
this._metricsEventType = Metrics.EVENT_TYPE.APP_MENU;
}

Menu.prototype._getMenuItemId = function (commandId) {
Expand Down Expand Up @@ -733,7 +735,7 @@ define(function (require, exports, module) {
event.stopPropagation();
return true;
}
Metrics.countEvent(Metrics.EVENT_TYPE.UI_MENU, "click", menuItem._command.getID());
Metrics.countEvent(self._metricsEventType || Metrics.EVENT_TYPE.UI_MENU, "click", menuItem._command.getID());
logger.leaveTrail("UI Menu Click: " + menuItem._command.getID());
MainViewManager.focusActivePane();
const commandId = menuItem._command.getID();
Expand Down Expand Up @@ -909,6 +911,7 @@ define(function (require, exports, module) {
}

let menu = new ContextMenu(id);
menu._metricsEventType = this._metricsEventType;
contextMenuMap[id] = menu;

let menuItemID = this.id + "-" + id;
Expand Down Expand Up @@ -1544,6 +1547,7 @@ define(function (require, exports, module) {
*/
function ContextMenu(id) {
Menu.apply(this, arguments);
this._metricsEventType = Metrics.EVENT_TYPE.UI_MENU;

let $newMenu = $("<li class='dropdown context-menu' id='" + StringUtils.jQueryIdEscape(id) + "'></li>"),
$popUp = $("<ul class='dropdown-menu'></ul>"),
Expand Down
6 changes: 4 additions & 2 deletions src/utils/Metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ define(function (require, exports, module) {
* The Type of events that can be specified as an `eventType` in the API calls.
*
* ### Properties
* `PLATFORM`, `PROJECT`, `THEMES`, `EXTENSIONS`, `EXTENSIONS`, `UI`, `UI_DIALOG`, `UI_BOTTOM_PANEL`,
* `UI_SIDE_PANEL`, `LIVE_PREVIEW`, `CODE_HINTS`, `EDITOR`, `SEARCH`, `SHARING`, `PERFORMANCE`, `NEW_PROJECT`
* `PLATFORM`, `PROJECT`, `THEMES`, `EXTENSIONS`, `EXTENSIONS`, `UI`, `APP_MENU`, `UI_MENU`, `UI_DIALOG`,
* `UI_BOTTOM_PANEL`, `UI_SIDE_PANEL`, `LIVE_PREVIEW`, `CODE_HINTS`, `EDITOR`, `SEARCH`, `SHARING`,
* `PERFORMANCE`, `NEW_PROJECT`
* `ERROR`, `USER`, `NODEJS`, `LINT`, `GIT`, `AUTH`, `PRO`, `GUIDE`
*
* @typedef EVENT_TYPE
Expand All @@ -106,6 +107,7 @@ define(function (require, exports, module) {
EXTENSIONS: "extensions",
NOTIFICATIONS: "notify",
UI: "UI",
APP_MENU: "appMenu",
UI_MENU: "UIMenu",
UI_DIALOG: "ui-dialog",
UI_BOTTOM_PANEL: "ui-bottomPanel",
Expand Down
Loading