tapspace
Version:
A zoomable user interface lib for web apps
26 lines (22 loc) • 482 B
JavaScript
module.exports = function (control) {
// @Viewport:removeControl(control)
//
// Remove control from the viewport.
//
// Parameters
// control
// a ControlComponent
//
// Return
// this, for chaining
//
// Unregister all listeners.
if (control.unbind) {
control.unbind()
}
// Detach from document
const controlElem = control.element
const containerElem = this.controls.element
containerElem.removeChild(controlElem)
return this
}