浏览代码

Moved echo-server.js to test utils. Added additonal condition for editor element. Updated manual test description.

Szymon Kupś 8 年之前
父节点
当前提交
03f88d35e4

+ 1 - 1
packages/ckeditor5-core/src/editor/standardeditor.js

@@ -116,7 +116,7 @@ export default class StandardEditor extends Editor {
 		const element = this.element;
 		const element = this.element;
 
 
 		// When replacing textarea which is inside form element.
 		// When replacing textarea which is inside form element.
-		if ( element.tagName.toLowerCase() === 'textarea' && element.form ) {
+		if ( element && element.tagName.toLowerCase() === 'textarea' && element.form ) {
 			let originalSubmit;
 			let originalSubmit;
 			const form = element.form;
 			const form = element.form;
 			const onSubmit = () => this.updateEditorElement();
 			const onSubmit = () => this.updateEditorElement();

packages/ckeditor5-core/tests/_assets/echo-server.js → packages/ckeditor5-core/tests/_utils/echo-server.js


+ 1 - 1
packages/ckeditor5-core/tests/manual/formsubmit.md

@@ -1,6 +1,6 @@
 ## Updating editor element when submitting a form
 ## Updating editor element when submitting a form
 
 
-1. Start simple HTTP server located in `ckeditor5-core/tests/_assets/` by calling `node echo-server.js`.
+1. Start simple HTTP server located in `ckeditor5-core/tests/_utils/` by calling `node echo-server.js`.
 1. Change editor's contents and press `Submit form` button. You should be redirected to a page which echoes POST data.
 1. Change editor's contents and press `Submit form` button. You should be redirected to a page which echoes POST data.
 Check if submitted contents match editor contents.
 Check if submitted contents match editor contents.
 1. Go back to test page and refresh it. Change editor contents and press `Submit by calling form.submit()` button.
 1. Go back to test page and refresh it. Change editor contents and press `Submit by calling form.submit()` button.