mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Add Workspace::panelForItem()
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user