Don't open items in disallowed locations

This commit is contained in:
Matthew Dapena-Tretter
2017-03-27 15:21:22 -07:00
parent 41953ae7d6
commit 401a549bf5

View File

@@ -684,6 +684,9 @@ module.exports = class Workspace extends Model {
location = item.getDefaultLocation()
}
const allowedLocations = typeof item.getAllowedLocations === 'function' ? item.getAllowedLocations() : ALL_LOCATIONS
location = allowedLocations.includes(location) ? location : allowedLocations[0]
container = this.docks[location] || this.getCenter()
pane = container.getActivePane()
switch (options.split) {
@@ -1620,3 +1623,5 @@ module.exports = class Workspace extends Model {
}
}
}
const ALL_LOCATIONS = ['center', 'left', 'right', 'bottom']