浏览代码

Remove redundant TableSelection property.

Maciej Gołaszewski 5 年之前
父节点
当前提交
91e7f2187c
共有 2 个文件被更改,包括 1 次插入45 次删除
  1. 0 10
      packages/ckeditor5-table/src/tableselection.js
  2. 1 35
      packages/ckeditor5-table/tests/tableselection.js

+ 0 - 10
packages/ckeditor5-table/src/tableselection.js

@@ -62,16 +62,6 @@ export default class TableSelection extends Plugin {
 	}
 	}
 
 
 	/**
 	/**
-	 * Flag indicating that table selection is selecting valid ranges in table cell.
-	 *
-	 * @readonly
-	 * @member {Boolean} #isSelectingAndSomethingElse
-	 */
-	get isSelectingAndSomethingElse() {
-		return this.isSelecting && this._startElement && this._endElement && this._startElement !== this._endElement;
-	}
-
-	/**
 	 * @inheritDoc
 	 * @inheritDoc
 	 */
 	 */
 	init() {
 	init() {

+ 1 - 35
packages/ckeditor5-table/tests/tableselection.js

@@ -37,40 +37,6 @@ describe( 'table selection', () => {
 	} );
 	} );
 
 
 	describe( 'TableSelection', () => {
 	describe( 'TableSelection', () => {
-		describe( 'isSelectingAndSomethingElse()', () => {
-			it( 'should be false if selection is not started', () => {
-				expect( tableSelection.isSelectingAndSomethingElse ).to.be.false;
-			} );
-
-			it( 'should be true if selection is selecting two different cells', () => {
-				tableSelection.startSelectingFrom( modelRoot.getNodeByPath( [ 0, 0, 0 ] ) );
-				tableSelection.setSelectingTo( modelRoot.getNodeByPath( [ 0, 0, 1 ] ) );
-
-				expect( tableSelection.isSelectingAndSomethingElse ).to.be.true;
-			} );
-
-			it( 'should be false if selection start/end is selecting the same table cell', () => {
-				tableSelection.startSelectingFrom( modelRoot.getNodeByPath( [ 0, 0, 0 ] ) );
-				tableSelection.setSelectingTo( modelRoot.getNodeByPath( [ 0, 0, 0 ] ) );
-
-				expect( tableSelection.isSelectingAndSomethingElse ).to.be.false;
-			} );
-
-			it( 'should be false if selection has no end cell', () => {
-				tableSelection.startSelectingFrom( modelRoot.getNodeByPath( [ 0, 0, 0 ] ) );
-
-				expect( tableSelection.isSelectingAndSomethingElse ).to.be.false;
-			} );
-
-			it( 'should be false if selection has ended', () => {
-				tableSelection.startSelectingFrom( modelRoot.getNodeByPath( [ 0, 0, 0 ] ) );
-				tableSelection.setSelectingTo( modelRoot.getNodeByPath( [ 0, 0, 1 ] ) );
-				tableSelection.stopSelection();
-
-				expect( tableSelection.isSelectingAndSomethingElse ).to.be.false;
-			} );
-		} );
-
 		describe( 'startSelectingFrom()', () => {
 		describe( 'startSelectingFrom()', () => {
 			it( 'should not change model selection', () => {
 			it( 'should not change model selection', () => {
 				const spy = sinon.spy();
 				const spy = sinon.spy();
@@ -263,7 +229,7 @@ describe( 'table selection', () => {
 
 
 				tableSelection.clearSelection();
 				tableSelection.clearSelection();
 
 
-				expect( tableSelection.isSelectingAndSomethingElse ).to.be.false;
+				expect( tableSelection.isSelecting ).to.be.false;
 			} );
 			} );
 
 
 			it( 'should not reset model selections', () => {
 			it( 'should not reset model selections', () => {