Component and other handler deregisterations

This commit is contained in:
Mo Bitar
2020-03-24 12:12:07 -05:00
parent ee7cb1fce6
commit 7aa38cbdb8
11 changed files with 476 additions and 310 deletions

View File

@@ -19,8 +19,9 @@ class RevisionPreviewModalCtrl {
}
$onDestroy() {
if (this.identifier) {
this.application.componentManager.deregisterHandler(this.identifier);
if (this.unregisterComponent) {
this.unregisterComponent();
this.unregisterComponent = null;
}
}
@@ -49,9 +50,8 @@ class RevisionPreviewModalCtrl {
});
editorCopy.readonly = true;
editorCopy.lockReadonly = true;
this.identifier = editorCopy.uuid;
this.application.componentManager.registerHandler({
identifier: this.identifier,
this.unregisterComponent = this.application.componentManager.registerHandler({
identifier: editorCopy.uuid,
areas: ['editor-editor'],
contextRequestHandler: (component) => {
if (component === this.editor) {