🎨 Refactor: Extract getVisiblePanes() function

This commit is contained in:
Jason Rudolph
2017-05-31 12:01:10 -04:00
parent 0e3dfc3ba1
commit 8cae9a1365
2 changed files with 5 additions and 5 deletions

View File

@@ -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)

View File

@@ -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}.