Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
wip: ckeditor5#1731 - remove useless nulls.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Jun 5, 2019
1 parent 66e22d1 commit 067bd09
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
6 changes: 2 additions & 4 deletions src/linkui.js
Expand Up @@ -89,10 +89,8 @@ export default class LinkUI extends Plugin {
super.destroy();

// Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
this.formView && this.formView.destroy();
this.formView = null;
this.actionsView && this.actionsView.destroy();
this.actionsView = null;
this.formView.destroy();
this.actionsView.destroy();
}

/**
Expand Down
10 changes: 4 additions & 6 deletions src/ui/linkactionsview.js
Expand Up @@ -134,16 +134,14 @@ export default class LinkActionsView extends View {

destroy() {
super.destroy();
this.focusTracker && this.focusTracker && this.focusTracker.destroy(); this.focusTracker = null;
this.keystrokes && this.keystrokes && this.keystrokes.destroy(); this.keystrokes = null;
this._focusCycler && this._focusCycler && this._focusCycler.destroy(); this._focusCycler = null;

this.focusTracker.destroy();
this.keystrokes.destroy();
this._focusCycler.destroy();

this.previewButtonView && this.previewButtonView.destroy();
this.previewButtonView = null;
this.editButtonView && this.editButtonView.destroy();
this.editButtonView = null;
this.unlinkButtonView && this.unlinkButtonView.destroy();
this.unlinkButtonView = null;
}

/**
Expand Down
17 changes: 7 additions & 10 deletions src/ui/linkformview.js
Expand Up @@ -130,16 +130,13 @@ export default class LinkFormView extends View {
destroy() {
super.destroy();

this.focusTracker && this.focusTracker && this.focusTracker.destroy(); this.focusTracker = null;
this.keystrokes && this.keystrokes && this.keystrokes.destroy(); this.keystrokes = null;
this._focusCycler && this._focusCycler && this._focusCycler.destroy(); this._focusCycler = null;
// todo not:
this.urlInputView && this.urlInputView.destroy();
this.urlInputView = null;
this.saveButtonView && this.saveButtonView.destroy();
this.saveButtonView = null;
this.cancelButtonView && this.cancelButtonView.destroy();
this.cancelButtonView = null;
this.focusTracker.destroy();
this.keystrokes.destroy();
this._focusCycler.destroy();

this.urlInputView.destroy();
this.saveButtonView.destroy();
this.cancelButtonView.destroy();
}

/**
Expand Down

0 comments on commit 067bd09

Please sign in to comment.