Skip to content

Commit 99699fc

Browse files
committed
Fixed minor bug with count of elements in color picking panel.
1 parent 98d8de9 commit 99699fc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugins/colorbutton/plugin.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ CKEDITOR.plugins.add( 'colorbutton', {
102102
function renderColors( panel, type, colorBoxId ) {
103103
var output = [],
104104
colors = config.colorButton_colors.split( ',' ),
105+
// Tells if we should include "More Colors..." button.
106+
moreColorsEnabled = editor.plugins.colordialog &&
107+
( config.colorButton_enableMore === undefined || config.colorButton_enableMore ),
105108
// aria-setsize and aria-posinset attributes are used to indicate size of options, because
106109
// screen readers doesn't play nice with table, based layouts (#12097).
107-
total = colors.length + ( config.colorButton_enableMore ? 2 : 1 );
110+
total = colors.length + ( moreColorsEnabled ? 2 : 1 );
108111

109112
var clickFn = CKEDITOR.tools.addFunction( function( color, type ) {
110113
if ( color == '?' ) {
@@ -198,7 +201,7 @@ CKEDITOR.plugins.add( 'colorbutton', {
198201
}
199202

200203
// Render the "More Colors" button.
201-
if ( editor.plugins.colordialog && config.colorButton_enableMore === undefined || config.colorButton_enableMore ) {
204+
if ( moreColorsEnabled ) {
202205
output.push( '</tr>' +
203206
'<tr>' +
204207
'<td colspan=8 align=center>' +

0 commit comments

Comments
 (0)