-
Notifications
You must be signed in to change notification settings - Fork 28
Allow to pass initial data to the editor constructor #38
Conversation
src/inlineeditor.js
Outdated
* import ... | ||
* | ||
* InlineEditor | ||
* .create( '<p>Hello world!</p>, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing '
I miss a slightly better explanation what you can find in Apart from that, all LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I improved a little the manual test. Except that, everything looks and works fine.
…hUI interface (added editor.element property).
src/inlineeditor.js
Outdated
@@ -86,7 +97,7 @@ export default class InlineEditor extends Editor { | |||
this.ui.destroy(); | |||
|
|||
return super.destroy() | |||
.then( () => setDataInElement( this.element, data ) ); | |||
.then( () => setDataInElement( this.sourceElement, data ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there's no source element?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throws an ugly error. I'm on it.
Suggested merge commit message (convention)
Feature: Editor can be created with initial data passed to the constructor. Closes ckeditor/ckeditor5#2271.
BREAKING CHANGE:
InlineEditor#element
is now available asInlineEditor#sourceElement
. See ckeditor/ckeditor5#2882.Requires: ckeditor/ckeditor5-core#129