Opened 3 years ago

Last modified 3 years ago

#16664 confirmed Bug

Setting two styles with the same name for different widgets is not properly handled by stylescombo plugin.

Reported by: kkrzton Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Style sets for widgets can be set like:

CKEDITOR.replace( 'editor1', {
    stylesSet: [
        { name: 'Clean', type: 'widget', widget: 'image', attributes: { 'class': 'clean' } }
    ]
} );

or in styles.js:

CKEDITOR.stylesSet.add( 'default', [
    { name: '240p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-240p' } },
    { name: '360p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-360p' } },
] };

When trying to set two styles with the same name but for different widget type, like:

{ name: '240p', type: 'widget', widget: 'embedSemantic', attributes: { 'class': 'embed-240p' } },
{ name: '240p', type: 'widget', widget: 'embed', attributes: { 'class': 'embed-240p' } },

The stylescombo uses only style defined for latter widget type. It happens because stylescombo uses style names as ids internally and there is a collision so previous style gets overwritten.

In some cases there may be a need to provide same styles for different widget types.

Expected result

It is possible to set styles with the same name for different widget types. It is properly handled by stylescombo.

Actual result

Stylescombo cannot handle styles with the same name.

Generally, there may be two cases:

  1. Setting different styles with the same name for different widget types.
  2. Setting same styles for different widget types.

Enabling adding styles with the same name for different widget types solves both of the above issues, however, it is not optimal for the second one (optimal could be, e.g. passing array of widget types/names). So we might consider different approaches for this issue.

Change History (1)

comment:1 Changed 3 years ago by kkrzton

Status: newconfirmed
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy