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

Create separators for toolbars #5309

Closed
Reinmar opened this issue Feb 2, 2017 · 5 comments · Fixed by ckeditor/ckeditor5-ui#160
Closed

Create separators for toolbars #5309

Reinmar opened this issue Feb 2, 2017 · 5 comments · Fixed by ckeditor/ckeditor5-ui#160
Assignees
Labels
package:ui type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Feb 2, 2017

Cause this is really confusing now:

image

@Reinmar Reinmar assigned Reinmar and unassigned Reinmar Feb 2, 2017
@fredck
Copy link
Contributor

fredck commented Feb 2, 2017

As well an way to guarantee the order, so we have: full side | alt

@Reinmar
Copy link
Member Author

Reinmar commented Feb 2, 2017

This is a completely different issue. There's no custom order support right now – order of buttons is directly inherited from the order of items in the config. And the order of items in the config depends on the order in which plugins are loaded now, though, you can override it as the developer.

AFAIR, CKEditor 4 supports some menu items priority setting. We'd need something similar here to decouple the order in which plugins were loaded (which is linked to the order of buttons in the configuration) from the order of items in the toolbar.

@Reinmar
Copy link
Member Author

Reinmar commented Feb 2, 2017

When reporting https://github.com/ckeditor/ckeditor5-ui/issues/155 I realised that there's a problem. One plugin doesn't know about the other so neither of them can decide to put a separator between them. So the separator must be defined differently.

The first idea which came to my mind is that the image style plugin could add its item as a "toolbar group", so we'd have configuration which looks like this:

config.image.defaultToolbar = [
  'imageAlternativeText',
  [
    'imageStyleFull',
    'imageStyleSide'
  ]
];

And, with support for order:

config.image.defaultToolbar = [
  { name: 'imageAlternativeText', order: 10 },
  { 
    items: [
      'imageStyleFull',
      'imageStyleSide'
    ],
    order: 0
  }
];

A separator would be displayed between two groups or between a group and a simple item.

PS. We used to have a ticket for toolbar configuration, but I can't find it now. This is part of that bigger issue.

@Reinmar
Copy link
Member Author

Reinmar commented Feb 24, 2017

We don't want to work on toolbar groups or priorities right now as I mentioned in https://github.com/ckeditor/ckeditor5-ui/issues/155#issuecomment-282300881.

So the separator will be a visual thing only and it needs to be directly specified in the configuration:

toolbar: [ 'imageTextAlternative', '|', 'imageStyleFull', 'imageStyleSide' ]

@fredck
Copy link
Contributor

fredck commented Feb 24, 2017

I'm sure you meant this:

toolbar: [ 'imageStyleFull', 'imageStyleSide', '|' , 'imageTextAlternative' ]

;)

Reinmar referenced this issue in ckeditor/ckeditor5-ui Feb 28, 2017
Feature: Added support for toolbar item separators. Closes #154.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-ui Oct 9, 2019
@mlewand mlewand added this to the iteration 8 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:feature This issue reports a feature request (an idea for a new functionality or a missing option). package:ui labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:ui type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants