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

Commit

Permalink
Merge 0bd85b6 into 6852559
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Jun 14, 2019
2 parents 6852559 + 0bd85b6 commit c3f9236
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/manual/memory.js
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals console:false, document, window */
/* globals console, document */

import ClassicEditor from '../../src/classiceditor';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
Expand All @@ -15,6 +15,8 @@ import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articleplugi
* - add event listeners with () => {} methods which reference other
*/
function initEditor() {
let editor;

ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ ArticlePluginSet ],
Expand Down Expand Up @@ -51,7 +53,7 @@ function initEditor() {
}
} )
.then( newEditor => {
window.editor = newEditor;
editor = newEditor;

document.getElementById( 'destroyEditor' ).addEventListener( 'click', destroyEditor );
} )
Expand All @@ -60,8 +62,8 @@ function initEditor() {
} );

function destroyEditor() {
window.editor.destroy().then( () => console.log( 'Editor was destroyed' ) );
window.editor = null;
editor.destroy().then( () => console.log( 'Editor was destroyed' ) );
editor = null;
document.getElementById( 'destroyEditor' ).removeEventListener( 'click', destroyEditor );
}
}
Expand Down

0 comments on commit c3f9236

Please sign in to comment.