tapspace
Version:
A zoomable user interface lib for web apps
22 lines (20 loc) • 500 B
JavaScript
module.exports = function (spaceId) {
// @TreeLoader:removeSpace(spaceId)
//
// Remove the space, given that the space exists.
// Does not remove the children.
//
// Parameters:
// parentId
// a string
//
const space = this.spaces[spaceId]
if (space) {
this.emit('close', { id: spaceId, space: space })
delete this.spaces[spaceId]
delete this.demand[spaceId]
space.remove()
// Enable hooking to removals
this.emit('closed', { id: spaceId })
}
}