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

Merge branch 'master' into i/3287

Maciej Gołaszewski 6 лет назад
Родитель
Сommit
e3f217035f

+ 1 - 3
packages/ckeditor5-table/src/commands/mergecellcommand.js

@@ -64,10 +64,8 @@ export default class MergeCellCommand extends Command {
 	refresh() {
 		const cellToMerge = this._getMergeableCell();
 
-		this.isEnabled = !!cellToMerge;
-		// In order to check if currently selected cell can be merged with one defined by #direction some computation are done beforehand.
-		// As such we can cache it as a command's value.
 		this.value = cellToMerge;
+		this.isEnabled = !!cellToMerge;
 	}
 
 	/**

+ 7 - 0
packages/ckeditor5-table/src/tableediting.js

@@ -46,6 +46,13 @@ export default class TableEditing extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
+	static get pluginName() {
+		return 'TableEditing';
+	}
+
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		const editor = this.editor;
 		const model = editor.model;

+ 1 - 1
packages/ckeditor5-table/src/utils.js

@@ -23,7 +23,7 @@ import { findAncestor } from './commands/utils';
 export function toTableWidget( viewElement, writer ) {
 	writer.setCustomProperty( 'table', true, viewElement );
 
-	return toWidget( viewElement, writer, { hasSelectionHandler: true } );
+	return toWidget( viewElement, writer, { hasSelectionHandle: true } );
 }
 
 /**

+ 2 - 2
packages/ckeditor5-table/tests/_utils/utils.js

@@ -107,8 +107,8 @@ export function viewTable( tableData, attributes = {} ) {
 		} ) }</tbody>` : '';
 
 	const figureAttributes = asWidget ?
-		'class="ck-widget ck-widget_with-selection-handler table" contenteditable="false"' : 'class="table"';
-	const widgetHandler = '<div class="ck ck-widget__selection-handler"></div>';
+		'class="ck-widget ck-widget_with-selection-handle table" contenteditable="false"' : 'class="table"';
+	const widgetHandler = '<div class="ck ck-widget__selection-handle"></div>';
 
 	return `<figure ${ figureAttributes }>${ asWidget ? widgetHandler : '' }<table>${ thead }${ tbody }</table></figure>`;
 }

+ 10 - 10
packages/ckeditor5-table/tests/converters/downcast.js

@@ -333,8 +333,8 @@ describe( 'downcast converters', () => {
 				setModelData( model, modelTable( [ [ '' ] ] ) );
 
 				expect( formatTable( getViewData( viewDocument, { withoutSelection: true } ) ) ).to.equal( formatTable(
-					'<figure class="ck-widget ck-widget_with-selection-handler table" contenteditable="false">' +
-					'<div class="ck ck-widget__selection-handler"></div>' +
+					'<figure class="ck-widget ck-widget_with-selection-handle table" contenteditable="false">' +
+					'<div class="ck ck-widget__selection-handle"></div>' +
 						'<table>' +
 							'<tbody>' +
 								'<tr>' +
@@ -566,8 +566,8 @@ describe( 'downcast converters', () => {
 
 				expect( formatTable(
 					getViewData( viewDocument, { withoutSelection: true } ) ) ).to.equal( formatTable(
-					'<figure class="ck-widget ck-widget_with-selection-handler table" contenteditable="false">' +
-						'<div class="ck ck-widget__selection-handler"></div>' +
+					'<figure class="ck-widget ck-widget_with-selection-handle table" contenteditable="false">' +
+						'<div class="ck ck-widget__selection-handle"></div>' +
 						'<table>' +
 							'<tbody>' +
 								'<tr>' +
@@ -712,8 +712,8 @@ describe( 'downcast converters', () => {
 				} );
 
 				expect( formatTable( getViewData( viewDocument, { withoutSelection: true } ) ) ).to.equal( formatTable(
-					'<figure class="ck-widget ck-widget_with-selection-handler table" contenteditable="false">' +
-					'<div class="ck ck-widget__selection-handler"></div>' +
+					'<figure class="ck-widget ck-widget_with-selection-handle table" contenteditable="false">' +
+					'<div class="ck ck-widget__selection-handle"></div>' +
 						'<table>' +
 							'<tbody>' +
 								'<tr>' +
@@ -889,8 +889,8 @@ describe( 'downcast converters', () => {
 				} );
 
 				expect( formatTable( getViewData( viewDocument, { withoutSelection: true } ) ) ).to.equal( formatTable(
-					'<figure class="ck-widget ck-widget_with-selection-handler table" contenteditable="false">' +
-					'<div class="ck ck-widget__selection-handler"></div>' +
+					'<figure class="ck-widget ck-widget_with-selection-handle table" contenteditable="false">' +
+					'<div class="ck ck-widget__selection-handle"></div>' +
 						'<table>' +
 							'<thead>' +
 								'<tr>' +
@@ -1103,8 +1103,8 @@ describe( 'downcast converters', () => {
 				} );
 
 				expect( formatTable( getViewData( viewDocument, { withoutSelection: true } ) ) ).to.equal( formatTable(
-					'<figure class="ck-widget ck-widget_with-selection-handler table" contenteditable="false">' +
-					'<div class="ck ck-widget__selection-handler"></div>' +
+					'<figure class="ck-widget ck-widget_with-selection-handle table" contenteditable="false">' +
+					'<div class="ck ck-widget__selection-handle"></div>' +
 						'<table>' +
 							'<tbody>' +
 								'<tr>' +

+ 4 - 0
packages/ckeditor5-table/tests/tableediting.js

@@ -41,6 +41,10 @@ describe( 'TableEditing', () => {
 		editor.destroy();
 	} );
 
+	it( 'should have pluginName', () => {
+		expect( TableEditing.pluginName ).to.equal( 'TableEditing' );
+	} );
+
 	it( 'should set proper schema rules', () => {
 		// Table:
 		expect( model.schema.isRegistered( 'table' ) ).to.be.true;