-
Notifications
You must be signed in to change notification settings - Fork 15
Changes in EditorWithUI and ElementApi interfaces #129
Conversation
…t" property to "EditorWithUI" interface.
@@ -19,8 +19,8 @@ const ElementApiMixin = { | |||
/** | |||
* @inheritDoc | |||
*/ | |||
updateElement() { |
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.
Let's add a check here that sourceElement
exists and throw otherwise. We expect that it may not be set.
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.
Done in e8cc7ed.
…ceElement is undefined.
src/editor/utils/elementapimixin.js
Outdated
* | ||
* @error elementapimixin-missing-sourceelement | ||
*/ | ||
throw new CKEditorError( 'elementapi-missing-sourceelement: The "sourceElement" is required by the "ElementApi" interface.' ); |
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.
How's an external developer supposed to understand this? He/she doesn't know our interfaces. They know what method they used. They should learn that it doesn't work if the editor wasn't created by passing the source element.
PS. Keep the error msg short. Explain it more thoroughly in the comment above.
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 error description but I'm not able to check it out so I'm not sure whether it works... Could you help me? :D
One more PR that requires these changes: ckeditor/ckeditor5-editor-decoupled#18 I missed it. The description of this PR has been updated. |
Tests: Adjusted the code to the changes in ckeditor5-editor-classic. See ckeditor/ckeditor5-core#129.
Renamed editor.element to editor.sourceElement. Introduced an "element" property to "EditorWithUI" interface.
Suggested merge commit message (convention)
Feature: Introduced the
#element
property to theEditorWithUI
interface. The#element
property fromElementApi
interface has been renamed to#sourceElement
. Closes ckeditor/ckeditor5#2882.BREAKING CHANGE: Renamed attribute in
ElementApi
interface – from#element
to#sourceElement
.BREAKING CHANGE: Renamed method name in
ElementApi
interface – fromupdateElement()
toupdateSourceElement()
.Required for:
BootstrapEditor
to changes in ckeditor5-core ckeditor5-ui#409CI: https://travis-ci.org/ckeditor/ckeditor5/builds/391732850 (ckeditor/ckeditor5@960395e)CI: https://travis-ci.org/ckeditor/ckeditor5/builds/398155989 (ckeditor/ckeditor5@220950d)CI: https://travis-ci.org/ckeditor/ckeditor5/builds/399007024 (ckeditor/ckeditor5@ed334a6)