ckeditor4-plugin-a11ychecker icon indicating copy to clipboard operation
ckeditor4-plugin-a11ychecker copied to clipboard

Add close event as possible alternative to handling closing in the Viewer.

Open Tade0 opened this issue 9 years ago • 2 comments

This PR is related to this: https://github.com/cksource/ckeditor-plugin-a11ychecker/issues/200#issuecomment-226125446 comment and should fix the problem in #200 without breaking encapsulation.

The idea is for the Viewer to implement the CKEDITOR.event interface and emit a close whenever the user wishes to close AC. The ViewerController can listen on that event and act accordingly.

Tade0 avatar Jun 15 '16 19:06 Tade0

close event seems to be a good idea.

Actually these two listeners are quite important as those explicitly blur the panel, meaning that in turn it will put the focus back to the editor. To test it just remove these listeners, and click the close button - it will close AC but if you type something, the editor won't get anything.

Actually esc key is handled globally by HotkeyManager so that's the reason why it's working when te listener was removed. Because of that we can even remove listening for esc here (on a side note, listener added in this PR would work only in close button, and it wouldn't blur the panel).

See my changes on top of the branch. Still there's an issue:

  • There are no manual tests.

mlewand avatar Jun 30 '16 16:06 mlewand

I found that one test is failing (https://github.com/cksource/ckeditor-plugin-a11ychecker/blob/t/200a/tests/Controller/CheckingMode.js#L46) throwing Unexpected error: viewerPanel.blur is not a function.

I run tests with dev version using t/200a branch with CKEditor major branch. Is this a bug or some mismatch in my testing environment configuration?

f1ames avatar Jul 26 '16 10:07 f1ames