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

Implement attachToAll() method using the new editor instance reference API #56

Closed
oleq opened this issue Jun 28, 2019 · 4 comments · Fixed by #58
Closed

Implement attachToAll() method using the new editor instance reference API #56

oleq opened this issue Jun 28, 2019 · 4 comments · Fixed by #58

Comments

@oleq
Copy link
Member

oleq commented Jun 28, 2019

Thanks ckeditor/ckeditor5-core#184 we can use domEditableElement.ckeditorInstance to get the editor instance. CKEditorInspector.attachToAll() would do:

const editables = document.querySelectorAll( '.ck-editable' );

for ( editable of editables ) {
    if ( not already attached to editable.ckeditorInstance ) {
        CKEditorInspector.attach( editable.ckeditorInstance );
    }
} 

to attach all editor instances automatically. That would be helpful:

  • in manual tests, because ATM we only discover window.editor and if there is more than a single editor, it's not inspected out-of-the-box. Note that we need a flag like window.CKEditorInspectorDontAttachAll so in some tests we can disable this feature.
  • in bookmarklets
@pomek
Copy link
Member

pomek commented Jun 28, 2019

Note that we need a flag like window.CKEditorInspectorDontAttachAll so in some tests we can disable this feature.

CKEditorInspector.disableAttachToAll = true

or something like that. We don't need to use the global scope for that.

@oleq
Copy link
Member Author

oleq commented Jun 28, 2019

It depends on the order of execution. Not sure if window.CKEditorInspector namespace would be available at that particular moment when the flag is to be set.

@pomek
Copy link
Member

pomek commented Jun 28, 2019

You're right, good point. What about element custom attrs ([data-ckeditor5-inspector="false"])?

@oleq
Copy link
Member Author

oleq commented Jun 28, 2019

You're right, good point. What about element custom attrs ([data-ckeditor5-inspector="false"])?

What about the ClassicEditor?

@oleq oleq self-assigned this Jul 4, 2019
@mlewand mlewand added this to the backlog milestone Sep 16, 2019
ma2ciek added a commit that referenced this issue Sep 20, 2019
Feature: Implemented the `CKEditorInspector#attachToAll()` method. Closes #56.
@Reinmar Reinmar modified the milestones: backlog, iteration 27 Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants