Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6107 from artoale/fix-context-menu
Browse files Browse the repository at this point in the history
Improve working-set context menu UI/UX
  • Loading branch information
JeffryBooher committed Mar 5, 2014
2 parents 8572b1d + 9273139 commit c59c542
Show file tree
Hide file tree
Showing 7 changed files with 300 additions and 193 deletions.
21 changes: 15 additions & 6 deletions src/command/DefaultMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ define(function (require, exports, module) {

var AppInit = require("utils/AppInit"),
Commands = require("command/Commands"),
ContextMenu = require("command/Menus"),
EditorManager = require("editor/EditorManager"),
Menus = require("command/Menus"),
Strings = require("strings");
Expand Down Expand Up @@ -195,7 +196,6 @@ define(function (require, exports, module) {
project_cmenu.addMenuItem(Commands.FILE_REFRESH);

var working_set_cmenu = Menus.registerContextMenu(Menus.ContextMenuIds.WORKING_SET_MENU);
working_set_cmenu.addMenuItem(Commands.FILE_CLOSE);
working_set_cmenu.addMenuItem(Commands.FILE_SAVE);
working_set_cmenu.addMenuItem(Commands.FILE_SAVE_AS);
working_set_cmenu.addMenuItem(Commands.FILE_RENAME);
Expand All @@ -204,11 +204,15 @@ define(function (require, exports, module) {
working_set_cmenu.addMenuDivider();
working_set_cmenu.addMenuItem(Commands.EDIT_FIND_IN_SUBTREE);
working_set_cmenu.addMenuDivider();
working_set_cmenu.addMenuItem(Commands.SORT_WORKINGSET_BY_ADDED);
working_set_cmenu.addMenuItem(Commands.SORT_WORKINGSET_BY_NAME);
working_set_cmenu.addMenuItem(Commands.SORT_WORKINGSET_BY_TYPE);
working_set_cmenu.addMenuDivider();
working_set_cmenu.addMenuItem(Commands.SORT_WORKINGSET_AUTO);
working_set_cmenu.addMenuItem(Commands.FILE_CLOSE);


var working_set_settings_cmenu = Menus.registerContextMenu(Menus.ContextMenuIds.WORKING_SET_SETTINGS_MENU);
working_set_settings_cmenu.addMenuItem(Commands.SORT_WORKINGSET_BY_ADDED);
working_set_settings_cmenu.addMenuItem(Commands.SORT_WORKINGSET_BY_NAME);
working_set_settings_cmenu.addMenuItem(Commands.SORT_WORKINGSET_BY_TYPE);
working_set_settings_cmenu.addMenuDivider();
working_set_settings_cmenu.addMenuItem(Commands.SORT_WORKINGSET_AUTO);

var editor_cmenu = Menus.registerContextMenu(Menus.ContextMenuIds.EDITOR_MENU);
// editor_cmenu.addMenuItem(Commands.NAVIGATE_JUMPTO_DEFINITION);
Expand Down Expand Up @@ -274,6 +278,11 @@ define(function (require, exports, module) {
working_set_cmenu.open(e);
});

/**
* Dropdown menu for workspace sorting
*/
Menus.ContextMenu.assignContextMenuToSelector("#working-set-option-btn", working_set_settings_cmenu);

// Prevent the browser context menu since Brackets creates a custom context menu
$(window).contextmenu(function (e) {
e.preventDefault();
Expand Down
Loading

0 comments on commit c59c542

Please sign in to comment.