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

Added possibility to call CKEDITOR.editor.addCommand with CKEDITOR.command instance as parameter #1786

Merged
merged 6 commits into from
Mar 23, 2018

Conversation

engineering-this
Copy link
Contributor

@engineering-this engineering-this commented Mar 13, 2018

What is the purpose of this pull request?

New Feature

Does your PR contain necessary tests?

All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

I've added check if CKEDITOR.editor.addComand has command instance passed it will register this command in editor and return it instead of creating new one.

Also added unit test to cover that case.

Closes #1582

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just two small things to polish.

core/editor.js Outdated
@@ -740,12 +740,14 @@
* }
* } );
*
* Since 4.10 this method accepts `CKEDITOR.command` instance as param.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"also accepts" IMO sounds more suitable.

@@ -302,5 +302,30 @@ bender.test( {
editor._.elementsPath.onClick( 0 );

wait();
},

'test addCommand from command instance': function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to add test using CKEDITOR.command subclass, just in case to test if inherited commands are treated the same.

@mlewand mlewand closed this Mar 16, 2018
@mlewand mlewand changed the base branch from next to major March 16, 2018 10:18
@mlewand mlewand reopened this Mar 16, 2018
@mlewand
Copy link
Contributor

mlewand commented Mar 16, 2018

Sorry, I've removed the next branch before rebasing all the PRs that were based on it. This PR is now rebased onto latest major (4.10.0).

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Comandeer Comandeer merged commit 1abc295 into major Mar 23, 2018
@Comandeer Comandeer deleted the t/1582 branch March 23, 2018 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants