Browse Source

Add "ck-hidden" class binding for no-color preview

panr 6 years ago
parent
commit
6cf96e2cd2
1 changed files with 11 additions and 1 deletions
  1. 11 1
      packages/ckeditor5-table/src/ui/colorinputview.js

+ 11 - 1
packages/ckeditor5-table/src/ui/colorinputview.js

@@ -151,7 +151,17 @@ export default class ColorInputView extends View {
 				style: {
 					backgroundColor: bind.to( 'value' )
 				}
-			}
+			},
+			children: [ {
+				tag: 'span',
+				attributes: {
+					class: [
+						'ck',
+						'ck-dropdown__color-picker-preview--no-color',
+						bind.if( 'value', 'ck-hidden', value => value != '' )
+					]
+				}
+			} ]
 		} );
 
 		dropdown.buttonView.extendTemplate( {