mirror of
https://github.com/atom/atom.git
synced 2026-02-06 12:44:59 -05:00
🎨 Refactor: Extract getVisiblePaneContainers() function
This commit is contained in:
@@ -274,9 +274,7 @@ class WorkspaceElement extends HTMLElement {
|
||||
const paneView = pane.getElement()
|
||||
const box = this.boundingBoxForPaneView(paneView)
|
||||
|
||||
const center = atom.workspace.getCenter()
|
||||
const visiblePaneContainers = atom.workspace.getPaneContainers()
|
||||
.filter(container => container === center || container.isVisible())
|
||||
const visiblePaneContainers = atom.workspace.getVisiblePaneContainers()
|
||||
|
||||
const visiblePanes = _.flatten(visiblePaneContainers.map(container => container.getPanes()))
|
||||
|
||||
|
||||
@@ -1532,6 +1532,12 @@ module.exports = class Workspace extends Model {
|
||||
]
|
||||
}
|
||||
|
||||
getVisiblePaneContainers() {
|
||||
const center = this.getCenter()
|
||||
return atom.workspace.getPaneContainers()
|
||||
.filter(container => container === center || container.isVisible())
|
||||
}
|
||||
|
||||
/*
|
||||
Section: Panels
|
||||
|
||||
|
||||
Reference in New Issue
Block a user