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

Passing editor to attach() is confusing #48

Closed
oleq opened this issue Apr 16, 2019 · 2 comments · Fixed by #46
Closed

Passing editor to attach() is confusing #48

oleq opened this issue Apr 16, 2019 · 2 comments · Fixed by #46

Comments

@oleq
Copy link
Member

oleq commented Apr 16, 2019

ATM you can do

CKEditorInspector.attach( instance )
CKEditorInspector.attach( 'name', instance )

After https://github.com/ckeditor/ckeditor5-inspector/pull/46/files, it will be

CKEditorInspector.attach( instance, { opts } )
CKEditorInspector.attach( 'name', instance, { opts } )

That's a lot of cases to handle and it could be confusing. I'm for changing the API to something simpler, so there are always max 2 arguments:

CKEditorInspector.attach( instance, { opts } )
CKEditorInspector.attach( [ 'name', instance ], { opts } )

Or even

CKEditorInspector.attach( instance, { opts } )
CKEditorInspector.attach( { name: instance, otherName: otherInstance }, { opts } )

cc @mlewand @Reinmar

@mlewand
Copy link
Contributor

mlewand commented Apr 16, 2019

@oleq just for me to understand better, why is name required by the inspector in a first place?

@oleq
Copy link
Member Author

oleq commented Apr 18, 2019

So when you have 10 editors in a single web page (they could be very similar, having the same content, being empty), you know which one you inspect:

Screenshot 2019-04-18 at 11 44 31

For instance, you can have a form with 10 fields, each one a different editor. Without it, they would be named "editor-1", "editor-2", etc.. You'd rather want to have "name-editor", "post-editor", "signature-editor", etc. instead.

@oleq oleq self-assigned this Jun 17, 2019
@mlewand mlewand added this to the backlog milestone Sep 16, 2019
ma2ciek added a commit that referenced this issue Sep 20, 2019
Feature: Allowed attaching the inspector collapsed using a configuration passed to `CKEditorInspector#attach()`. Implemented the `CKEditorInspector#destroy()` method. Unified `CKEditorInspector#attach()` arguments syntax and allowed attaching to multiple instances at a time. Closes #44. Closes #42. Closes #48.

BREAKING CHANGE: The `CKEditorInspector.attach( 'editor-name', editor );` syntax was deprecated and replaced by an object literal `CKEditorInspector.attach( { 'editor-name': editor, ... } );`.
@oleq oleq modified the milestones: backlog, iteration 27 Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants