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

Expose public API for refreshing widget mask and parts #3857

Merged
merged 23 commits into from
Feb 18, 2020
Merged

Expose public API for refreshing widget mask and parts #3857

merged 23 commits into from
Feb 18, 2020

Conversation

Dumluregn
Copy link
Contributor

@Dumluregn Dumluregn commented Feb 12, 2020

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

Did you follow CKEditor 4 code style guide?

Your code should follow guidelines from CKEditor 4 code style guide which helps keep the entire codebase consistent.

  • PR is consistent with code style guide

What is the proposed changelog entry for this pull request?

*[#3775](https://github.com/ckeditor/ckeditor4/issues/3775): Widget [mask](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_widget.html#property-mask) and [parts](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_widget.html#property-parts) can now be refreshed dynamically via API calls.

What changes did you make?

I created two public methods: refreshMask() and refreshParts() aliasing accordingly setupMask() and setupParts() private methods. They needed to be slightly adjusted to handle the case in which one widget part was created at widget initialisation and the other one didn't (e.g. because it wasn't rendered yet). For that reason I also updated existing unit test for setting up parts.

Also in unit test there was an issue with IE8 that I tried to resolve for a few hours but still didn't find out why the first call of elementFromPoint() after refreshing parts and mask returns null and just added the second call.

Which issues your PR resolves?

Closes #3775.

@f1ames f1ames self-requested a review February 13, 2020 11:55
@f1ames f1ames self-assigned this Feb 13, 2020
Copy link
Contributor

@f1ames f1ames left a comment

Choose a reason for hiding this comment

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

This PR introduces unexpected breaking change (~95 test fails on CI) - see review comments for more details.

plugins/widget/plugin.js Outdated Show resolved Hide resolved
plugins/widget/plugin.js Outdated Show resolved Hide resolved
plugins/widget/plugin.js Outdated Show resolved Hide resolved
@f1ames f1ames self-assigned this Feb 18, 2020
Copy link
Contributor

@f1ames f1ames left a comment

Choose a reason for hiding this comment

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

Looks good, just some changes in unit tests needed 👍

tests/plugins/widget/refreshmaskapi.js Show resolved Hide resolved
@f1ames f1ames self-assigned this Feb 18, 2020
Copy link
Contributor

@f1ames f1ames left a comment

Choose a reason for hiding this comment

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

LGTM, good job 👍

@f1ames
Copy link
Contributor

f1ames commented Feb 18, 2020

Rebased onto latest major.

@f1ames f1ames merged commit 0074106 into major Feb 18, 2020
@CKEditorBot CKEditorBot deleted the t/3775 branch February 18, 2020 14:32
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.

It should be possible to refresh size/position of widget partial mask via public API
2 participants