Add Workspace::panelForItem()

This commit is contained in:
Ben Ogle
2014-12-03 12:46:42 -08:00
parent 6ec7b7b38d
commit 24f7638e8b
3 changed files with 25 additions and 0 deletions

View File

@@ -750,6 +750,16 @@ class Workspace extends Model
addModalPanel: (options={}) ->
@addPanel('modal', options)
# Essential: Returns the {Panel} associated with the given item. Returns
# `null` when the item has no panel.
#
# * `item` Item the panel contains
panelForItem: (item) ->
for location, container of @panelContainers
panel = container.panelForItem(item)
return panel if panel?
null
getPanels: (location) ->
@panelContainers[location].getPanels()