8
0
Просмотр исходного кода

Internal: Removed unused columns option. Instead it will simply be assigned in the CSS for now.

Marek Lewandowski 6 лет назад
Родитель
Сommit
effc417358

+ 1 - 3
packages/ckeditor5-special-characters/src/specialcharactersui.js

@@ -44,9 +44,7 @@ export default class SpecialCharactersUI extends Plugin {
 				selectOptions: getSelectViewOptions()
 			} );
 
-			const symbolTableView = new SpecialCharactersTableView( locale, {
-				columns: 10 // TODO: Read from config.
-			} );
+			const symbolTableView = new SpecialCharactersTableView( locale );
 
 			symbolTableView.delegate( 'execute' ).to( dropdownView, 'execute' );
 

+ 3 - 15
packages/ckeditor5-special-characters/src/ui/specialcharacterstableview.js

@@ -23,12 +23,8 @@ export default class SpecialCharactersTableView extends View {
 	 * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
 	 *
 	 * @param {module:utils/locale~Locale} [locale] The localization services instance.
-	 * @param {Object} config The configuration object.
-	 * @param {Array.<module:special-characters/specialcharacters~SpecialCharacterDefinition>} config.symbolDefinitions An array with
-	 * definitions of special characters to be displayed in the table.
-	 * @param {Number} config.columns The number of columns in the color grid.
 	 */
-	constructor( locale, { symbolDefinitions = [], columns } ) {
+	constructor( locale ) {
 		super( locale );
 
 		/**
@@ -55,19 +51,12 @@ export default class SpecialCharactersTableView extends View {
 		 */
 		this.keystrokes = new KeystrokeHandler();
 
-		/**
-		 * The number of columns in the special characters grid.
-		 *
-		 * @type {Number}
-		 */
-		this.columns = columns;
-
 		/**
 		 * An array with definitions of special characters to be displayed in the table.
 		 *
 		 * @member {Array.<module:special-characters/specialcharacters~SpecialCharacterDefinition>}
 		 */
-		this.symbolDefinitions = symbolDefinitions;
+		this.symbolDefinitions = [];
 
 		/**
 		 * Preserves the reference to {@link module:special-characters/ui/symbolgridview~SymbolGridView} used to create
@@ -149,8 +138,7 @@ export default class SpecialCharactersTableView extends View {
 	 */
 	_createSymbolGridView() {
 		const symbolGrid = new SymbolGridView( this.locale, {
-			symbolDefinitions: this.symbolDefinitions,
-			columns: this.columns
+			symbolDefinitions: this.symbolDefinitions
 		} );
 
 		symbolGrid.delegate( 'execute' ).to( this );

+ 1 - 8
packages/ckeditor5-special-characters/src/ui/symbolgridview.js

@@ -27,17 +27,11 @@ export default class SymbolGridView extends View {
 	 * @param {Object} options Component configuration
 	 * @param {Array.<module:special-characters/specialcharacters~SpecialCharacterDefinition>} [options.symbolDefinitions] Array with
 	 * definitions required to create the {@link module:special-characters/ui/symboltileview~SymbolTileView tiles}.
-	 * @param {Number} options.columns A number of columns to display the tiles.
 	 */
 	constructor( locale, options ) {
 		super( locale );
 
 		const symbolDefinitions = options && options.symbolDefinitions || [];
-		const viewStyleAttribute = {};
-
-		if ( options && options.columns ) {
-			viewStyleAttribute.gridTemplateColumns = `repeat( ${ options.columns }, 1fr)`;
-		}
 
 		/**
 		 * Collection of the child tile views.
@@ -100,8 +94,7 @@ export default class SymbolGridView extends View {
 				class: [
 					'ck',
 					'ck-symbol-grid'
-				],
-				style: viewStyleAttribute
+				]
 			}
 		} );
 	}

+ 3 - 2
packages/ckeditor5-special-characters/theme/components/symbolgrid/symbolgrid.css

@@ -3,6 +3,7 @@
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
- .ck.ck-symbol-grid {
+.ck.ck-symbol-grid {
 	display: grid;
-}
+	grid-template-columns: repeat(10, 1fr);
+}