Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up creating model, controllers, view and roots #2928

Closed
pjasiun opened this issue Dec 19, 2017 · 0 comments · Fixed by ckeditor/ckeditor5-core#114
Closed

Clean-up creating model, controllers, view and roots #2928

pjasiun opened this issue Dec 19, 2017 · 0 comments · Fixed by ckeditor/ckeditor5-core#114
Assignees
Labels
package:core type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@pjasiun
Copy link

pjasiun commented Dec 19, 2017

Right now the model is created in the Editor class, editing view in StandardEditor, model root is created in a creator class (i.e. ClassicEditor) and view root is created in a creators UI (i.e. ClassicEditorUI). Mess.

First of all, in the Editor class model should be created with both controllers, so:

https://github.com/ckeditor/ckeditor5-core/blob/f7bc3cfe65a6a000395ca9b5242603ffd2f92e14/src/editor/standardeditor.js#L44-L45

should be moved to from the StandardEditor to the Editor class. At the same time we could move keystrokes handler to the editor class keeping the whole initialisation in the one place.

Second issue is how roots should be initialised.

I believe that the default model root should be initialised in the Editor class too. More problematic is where (when) editing view root should be inited since it expect dom element to be defined. This is why I think that we could handle it a little bit different. Editing controllers could bind model roots collection (it need to become observable) and editing view roots collection, so it will be enought to create root on the model to have it in the editing view too. This way editing view will be created as soon as it should be created (see #647).

Binding editing view root and DOM element can be done later. It means that the binding will not be needed when view root will be created (it should work fine, I hope). Editing view document have attachDomRoot method which can be called later.

@pjasiun pjasiun closed this as completed Jan 11, 2018
pjasiun referenced this issue in ckeditor/ckeditor5-core Jan 11, 2018
Fix: Moved EditingController, DataController and EditingKeystrokeHandler from StandardEditor to Editor class. Closes #110.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-core Oct 9, 2019
@mlewand mlewand added this to the iteration 14 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:improvement This issue reports a possible enhancement of an existing feature. package:core labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:core type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants