瀏覽代碼

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

panr 6 年之前
父節點
當前提交
6cf96e2cd2
共有 1 個文件被更改,包括 11 次插入1 次删除
  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( {