Explorar el Código

Minor improvements for the manual test.

Kamil Piechaczek hace 7 años
padre
commit
4d28a859be

+ 1 - 1
packages/ckeditor5-editor-balloon/tests/manual/ballooneditor-data.html

@@ -1,5 +1,5 @@
 <p>
-	<button id="destroyEditor">Destroy editor</button>
+	<button id="destroyEditors">Destroy editors</button>
 	<button id="initEditor">Init editor</button>
 </p>
 

+ 7 - 3
packages/ckeditor5-editor-balloon/tests/manual/ballooneditor-data.js

@@ -10,14 +10,16 @@ import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articleplugi
 
 window.editors = [];
 const container = document.querySelector( '.container' );
+let counter = 1;
 
 function initEditor() {
 	BalloonEditor
-		.create( '<h2>Editor 1</h2><p>This is an editor instance.</p>', {
+		.create( `<h2>Editor ${ counter }</h2><p>This is an editor instance.</p>`, {
 			plugins: [ ArticlePluginSet ],
 			toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ]
 		} )
 		.then( editor => {
+			counter += 1;
 			window.editors.push( editor );
 			container.appendChild( editor.element );
 		} )
@@ -26,14 +28,16 @@ function initEditor() {
 		} );
 }
 
-function destroyEditor() {
+function destroyEditors() {
 	window.editors.forEach( editor => {
 		editor.destroy()
 			.then( () => {
 				editor.element.remove();
 			} );
 	} );
+	window.editors = [];
+	counter = 1;
 }
 
 document.getElementById( 'initEditor' ).addEventListener( 'click', initEditor );
-document.getElementById( 'destroyEditor' ).addEventListener( 'click', destroyEditor );
+document.getElementById( 'destroyEditors' ).addEventListener( 'click', destroyEditors );

+ 2 - 2
packages/ckeditor5-editor-balloon/tests/manual/ballooneditor-data.md

@@ -1,3 +1,3 @@
 1. Click "Init editor".
-2. New editor instance should be appended to the document with initial data in it.
-3. After clicking "Destroy editor" all editors should be removed from the document.
+2. New editor instance should be appended to the document with initial data in it. You can create more than one editor.
+3. After clicking "Destroy editors" all editors should be removed from the document.