mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
🎨 Refactor: Extract getVisiblePanes() function
This commit is contained in:
@@ -274,11 +274,7 @@ class WorkspaceElement extends HTMLElement {
|
||||
const paneView = pane.getElement()
|
||||
const box = this.boundingBoxForPaneView(paneView)
|
||||
|
||||
const visiblePaneContainers = atom.workspace.getVisiblePaneContainers()
|
||||
|
||||
const visiblePanes = _.flatten(visiblePaneContainers.map(container => container.getPanes()))
|
||||
|
||||
const paneViews = visiblePanes
|
||||
const paneViews = atom.workspace.getVisiblePanes()
|
||||
.map(otherPane => otherPane.getElement())
|
||||
.filter(otherPaneView => {
|
||||
const otherBox = this.boundingBoxForPaneView(otherPaneView)
|
||||
|
||||
@@ -1349,6 +1349,10 @@ module.exports = class Workspace extends Model {
|
||||
return _.flatten(this.getPaneContainers().map(container => container.getPanes()))
|
||||
}
|
||||
|
||||
getVisiblePanes() {
|
||||
return _.flatten(this.getVisiblePaneContainers().map(container => container.getPanes()))
|
||||
}
|
||||
|
||||
// Extended: Get the active {Pane}.
|
||||
//
|
||||
// Returns a {Pane}.
|
||||
|
||||
Reference in New Issue
Block a user