Commit Graph

13 Commits

Author SHA1 Message Date
Kevin Sawicki
589d489eb9 Retain role field from menu items config 2015-11-09 12:30:29 -08:00
Kevin Sawicki
23eacc1e58 Add explicit return after for loop 2015-03-19 11:48:40 -07:00
Kevin Sawicki
131ae0f9f7 Add visible to picked keys 2014-11-13 17:54:14 -08:00
Cheng Zhao
14fd4a9f7d 'enabled' is also a valid item attribute, fixes #3880 2014-10-23 10:34:15 +08:00
Nathan Sobo
d1b2147921 Store specificity based on the cloned item instead of the original 2014-10-08 15:55:41 -07:00
Nathan Sobo
9914c49773 Clone menu items before merging them in in menu-helpers 2014-10-08 15:27:09 -07:00
Nathan Sobo
6ce5356505 Fix handling of submenus in conversion of legacy context menu format 2014-10-02 10:47:03 -06:00
Nathan Sobo
b2cc28fb5b Rename commandOptions to commandDetail on context menu items 2014-09-30 12:15:56 -06:00
Nathan Sobo
4a0c5aaa70 Prevent adjacent menu separators 2014-09-30 12:06:27 -06:00
Nathan Sobo
eb929cb7a2 Honor item specificity while still preserving addition order
Rather than using order to specify item precedence, we now construct
a set of menu items for each element traversing upward from the target.
When merging items for a given element, we pass the specificity to the
merge function, which uses it to decide whether or not to clobber
existing items. When assembling the overall menu, we don’t ever clobber
to ensure that items added for elements closer to the target always win
over items matching further up the tree.
2014-09-30 12:06:27 -06:00
Nathan Sobo
36d5359ef4 Restore original context menu ordering
Previously I used CSS specificity to order the most specific / recently
added menu items for a given element *first* when building up the
context menu. When a duplicate label was found for a given menu I would
refrain from inserting it. Now instead I order things the opposite way.
The most specific / recently added items come later and items with the
same label are clobbered by later items.
2014-09-30 12:06:26 -06:00
Nathan Sobo
f8225a6441 Make arguments atom.contextMenu.add consistent with atom.menu.add 2014-09-30 12:06:08 -06:00
Nathan Sobo
504c4c7af6 Extract MenuHelpers from MenuManager for reuse by ContextMenuManager 2014-09-30 12:06:08 -06:00