mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Revert "Honor created()
function for an item in a submenu."
This reverts commit 9917ed39aa
.
Sorry, apparently I don't know how to use Git anymore.
I'm just trying to put this up for review and it went straight
to master instead.
This commit is contained in:
parent
9917ed39aa
commit
04b100fab8
@ -136,9 +136,12 @@ class ContextMenuManager
|
||||
|
||||
for itemSet in matchingItemSets
|
||||
for item in itemSet.items
|
||||
itemForEvent = @cloneItemForEvent(item, event)
|
||||
if itemForEvent
|
||||
MenuHelpers.merge(currentTargetItems, itemForEvent, itemSet.specificity)
|
||||
continue if item.devMode and not @devMode
|
||||
item = Object.create(item)
|
||||
if typeof item.shouldDisplay is 'function'
|
||||
continue unless item.shouldDisplay(event)
|
||||
item.created?(event)
|
||||
MenuHelpers.merge(currentTargetItems, item, itemSet.specificity)
|
||||
|
||||
for item in currentTargetItems
|
||||
MenuHelpers.merge(template, item, false)
|
||||
@ -147,19 +150,6 @@ class ContextMenuManager
|
||||
|
||||
template
|
||||
|
||||
# Returns an object compatible with `::add()` or `null`.
|
||||
cloneItemForEvent: (item, event) ->
|
||||
return null if item.devMode and not @devMode
|
||||
item = Object.create(item)
|
||||
if typeof item.shouldDisplay is 'function'
|
||||
return null unless item.shouldDisplay(event)
|
||||
item.created?(event)
|
||||
if Array.isArray(item.submenu)
|
||||
item.submenu = item.submenu
|
||||
.map((item) => @cloneItemForEvent(item, event))
|
||||
.filter((item) -> item isnt null)
|
||||
return item
|
||||
|
||||
convertLegacyItemsBySelector: (legacyItemsBySelector, devMode) ->
|
||||
itemsBySelector = {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user