Don't store default locations

This will probably be less confusing for developers experimenting with
changing the default location. Also, we avoid storing extra info we
don't really need.
This commit is contained in:
Matthew Dapena-Tretter
2017-04-04 13:48:09 -07:00
parent 881cbbd17f
commit fed2372c30
2 changed files with 32 additions and 7 deletions

View File

@@ -301,7 +301,17 @@ module.exports = class Workspace extends Model {
if (typeof item.getURI === 'function') {
const uri = item.getURI()
if (uri != null) {
this.itemLocationStore.save(item.getURI(), paneContainer.getLocation())
const location = paneContainer.getLocation()
let defaultLocation
if (typeof item.getDefaultLocation === 'function') {
defaultLocation = item.getDefaultLocation()
}
defaultLocation = defaultLocation || 'center'
if (location === defaultLocation) {
this.itemLocationStore.delete(item.getURI())
} else {
this.itemLocationStore.save(item.getURI(), location)
}
}
}
})