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

Allow adding custom CSS to editor context menu #2202

Closed
jswiderski opened this issue Jul 4, 2018 · 1 comment
Closed

Allow adding custom CSS to editor context menu #2202

jswiderski opened this issue Jul 4, 2018 · 1 comment
Assignees
Labels
changelog:api A changelog entry should be put in the API section of the changelog. status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Milestone

Comments

@jswiderski
Copy link
Contributor

Type of report

Feature request

Provide description of the new feature

Contents of editor menus, including context menu are being displayed inside an iframe. For context menu only editor.css file is being attached.

Two approaches can be used here:

  1. Attach contents.css to context menu iframe just like it is being done for dropdowns.
  2. Add configuration setting for specifying path to custom CSS file for editor context menu.

From what I have checked, the whole logic works in the following way:

  1. Everything starts with panel prototype using CSS:
    https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/panel/plugin.js#L114-L117

  2. That CSS gets inserted into array which later gest inserted into iframe:
    https://github.com/ckeditor/ckeditor-dev/blob/major/core/tools.js#L346-L360
    https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/panel/plugin.js#L75-L80
    https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/panel/plugin.js#L114-L117

  3. Context menu plugin is based on general Menu plugin which uses panel mentioned in point 1 to specify its own CSS:
    https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/menu/plugin.js#L163
    for which path is calculated based on getCssPath method:
    https://github.com/ckeditor/ckeditor-dev/blob/major/core/skin.js#L137-L163

It seems to me that the best place for inserting new CSS would be here:
https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/menu/plugin.js#L163
We could create a new configuration setting which would get read there.

@jswiderski jswiderski added type:feature A feature request. support An issue reported by a commercially licensed client. labels Jul 4, 2018
@msamsel msamsel added the status:confirmed An issue confirmed by the development team. label Sep 3, 2018
@jacekbogdanski jacekbogdanski self-assigned this Oct 11, 2018
@jacekbogdanski jacekbogdanski changed the title Allow adding custom CSS to editor context menu. Allow adding custom CSS to editor context menu Oct 11, 2018
@jacekbogdanski
Copy link
Member

Actually, this feature request seems much easier to implement than digging so deep into contextmenu dependencies. It just requires passing additional parameter into context menu base constructor call. I will create following PR with an improvement.

@Comandeer Comandeer added this to the 4.11.0 milestone Oct 25, 2018
@mlewand mlewand added changelog:api A changelog entry should be put in the API section of the changelog. target:major Any docs related issue that should be merged into a major branch. labels Nov 5, 2018
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. status:confirmed An issue confirmed by the development team. support An issue reported by a commercially licensed client. target:major Any docs related issue that should be merged into a major branch. type:feature A feature request.
Projects
None yet
Development

No branches or pull requests

5 participants