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

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

Closed
f1ames opened this issue Jan 13, 2020 · 0 comments · Fixed by #3857
Closed

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

f1ames opened this issue Jan 13, 2020 · 0 comments · Fixed by #3857
Assignees
Labels
changelog:api A changelog entry should be put in the API section of the changelog. plugin:widget The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:feature A feature request.

Comments

@f1ames
Copy link
Contributor

f1ames commented Jan 13, 2020

Type of report

Feature request

Provide description of the new feature

This is a follow up of #3240, where we have introduce a possibility to mask only part of the widget (see also https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_widget.html#property-mask). However, as reported in https://www.drupal.org/project/drupal/issues/3064572#comment-13283354 by @wimleers, there is an issue with mask refreshing due to specific Drupal Entity Embed CKEditor 4 plugin.

The Drupal Entity Embed plugin works in a way that it asynchronously fetches the entity HTML content (which may be slightly different depending on the entity type) and so there are two issues:

  • It is not possible to properly define widget.parts before entity HTML is fetched. Since fetching happens after widget initialisation and parts are processed on widget initialisation it becomes problematic. So the exact issue is that parts selector can be defined but entity HTML is not there on widget initialisation and would not be find.
  • Since HTML is dynamic (and can be refetched) during widget lifecycle, it should be possible to trigger mask refreshing by the API call (so it can be done by Entity Embed plugin after fetching and inserting the entity HTML).

I know the issue with parts was somehow workaround by manually updating widget.parts but it is not a perfect solution.

To sum up, we need to enable handling cases where widget content is loaded asynchronously (after initialisation) and part of the loaded content is masked correctly.

Extracting method for refreshing mask should be just aliasing the private function we have now. Not sure about refreshing parts, since we need to check if refreshing parts after the widget is initialised doesn't break anything.

@f1ames f1ames added type:feature A feature request. status:confirmed An issue confirmed by the development team. plugin:widget The plugin which probably causes the issue. workload:medium labels Jan 13, 2020
@Dumluregn Dumluregn self-assigned this Feb 4, 2020
@Dumluregn Dumluregn added the changelog:api A changelog entry should be put in the API section of the changelog. label Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:api A changelog entry should be put in the API section of the changelog. plugin:widget The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:feature A feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants