From 401a549bf53b22e0cb13db39fc1abd7429d1558a Mon Sep 17 00:00:00 2001 From: Matthew Dapena-Tretter Date: Mon, 27 Mar 2017 15:21:22 -0700 Subject: [PATCH] Don't open items in disallowed locations --- src/workspace.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/workspace.js b/src/workspace.js index 24df8ec1f..3e94eccaf 100644 --- a/src/workspace.js +++ b/src/workspace.js @@ -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']