mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Check an item's allowed locations when moving/copying to pane
This commit is contained in:
@@ -213,12 +213,22 @@ class PaneContainer {
|
||||
|
||||
moveActiveItemToPane (destPane) {
|
||||
const item = this.activePane.getActiveItem()
|
||||
|
||||
if (typeof item.getAllowedLocations === 'function' && !item.getAllowedLocations().includes(destPane.getContainer().getLocation())) {
|
||||
return
|
||||
}
|
||||
|
||||
this.activePane.moveItemToPane(item, destPane)
|
||||
destPane.setActiveItem(item)
|
||||
}
|
||||
|
||||
copyActiveItemToPane (destPane) {
|
||||
const item = this.activePane.copyActiveItem()
|
||||
|
||||
if (typeof item.getAllowedLocations === 'function' && !item.getAllowedLocations().includes(destPane.getContainer().getLocation())) {
|
||||
return
|
||||
}
|
||||
|
||||
destPane.activateItem(item)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user