|
@@ -470,11 +470,11 @@ export default class TableCellPropertiesView extends View {
|
|
|
|
|
|
|
|
borderWidthInput.set( {
|
|
borderWidthInput.set( {
|
|
|
label: t( 'Width' ),
|
|
label: t( 'Width' ),
|
|
|
- class: 'ck-table-form__border-width',
|
|
|
|
|
|
|
+ class: 'ck-table-form__border-width'
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
borderWidthInput.view.bind( 'value' ).to( this, 'borderWidth' );
|
|
borderWidthInput.view.bind( 'value' ).to( this, 'borderWidth' );
|
|
|
- borderWidthInput.bind( 'isEnabled' ).to( this, 'borderStyle', value => !!value );
|
|
|
|
|
|
|
+ borderWidthInput.bind( 'isEnabled' ).to( this, 'borderStyle', isBorderStyleSet );
|
|
|
borderWidthInput.view.on( 'input', () => {
|
|
borderWidthInput.view.on( 'input', () => {
|
|
|
this.borderWidth = borderWidthInput.view.element.value;
|
|
this.borderWidth = borderWidthInput.view.element.value;
|
|
|
} );
|
|
} );
|
|
@@ -484,7 +484,7 @@ export default class TableCellPropertiesView extends View {
|
|
|
const borderColorInput = new LabeledView( locale, createLabeledInputText );
|
|
const borderColorInput = new LabeledView( locale, createLabeledInputText );
|
|
|
borderColorInput.label = t( 'Color' );
|
|
borderColorInput.label = t( 'Color' );
|
|
|
borderColorInput.view.bind( 'value' ).to( this, 'borderColor' );
|
|
borderColorInput.view.bind( 'value' ).to( this, 'borderColor' );
|
|
|
- borderColorInput.bind( 'isEnabled' ).to( this, 'borderStyle', value => !!value );
|
|
|
|
|
|
|
+ borderColorInput.bind( 'isEnabled' ).to( this, 'borderStyle', isBorderStyleSet );
|
|
|
|
|
|
|
|
borderColorInput.view.on( 'input', () => {
|
|
borderColorInput.view.on( 'input', () => {
|
|
|
this.borderColor = borderColorInput.view.element.value;
|
|
this.borderColor = borderColorInput.view.element.value;
|
|
@@ -493,7 +493,7 @@ export default class TableCellPropertiesView extends View {
|
|
|
// Reset the border color and width fields when style is "none".
|
|
// Reset the border color and width fields when style is "none".
|
|
|
// https://github.com/ckeditor/ckeditor5/issues/6227
|
|
// https://github.com/ckeditor/ckeditor5/issues/6227
|
|
|
this.on( 'change:borderStyle', ( evt, name, value ) => {
|
|
this.on( 'change:borderStyle', ( evt, name, value ) => {
|
|
|
- if ( !value ) {
|
|
|
|
|
|
|
+ if ( !isBorderStyleSet( value ) ) {
|
|
|
this.borderColor = '';
|
|
this.borderColor = '';
|
|
|
this.borderWidth = '';
|
|
this.borderWidth = '';
|
|
|
}
|
|
}
|
|
@@ -775,3 +775,7 @@ export default class TableCellPropertiesView extends View {
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+function isBorderStyleSet( value ) {
|
|
|
|
|
+ return !!value;
|
|
|
|
|
+}
|