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

Merge branch 'i/7444-2SCM-refactor' into i/7444-2SCM-refactor-highlight

Tomek Wytrębowicz 5 лет назад
Родитель
Сommit
c39cf625a2

+ 2 - 9
packages/ckeditor5-typing/src/twostepcaretmovement.js

@@ -20,7 +20,7 @@ import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
  * Thanks to this (phantom) caret movement the user is able to type before/after as well as at the
  * beginning/end of an attribute.
  *
- * **Note:** This class support right–to–left (Arabic, Hebrew, etc.) content by mirroring its behavior
+ * **Note:** This plugin support right–to–left (Arabic, Hebrew, etc.) content by mirroring its behavior
  * but for the sake of simplicity examples showcase only left–to–right use–cases.
  *
  * # Forward movement
@@ -84,7 +84,7 @@ import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
  *
  *   		<$text a="true">ba{}r</$text>b{}az
  */
-export class TwoStepCaretMovement extends Plugin {
+export default class TwoStepCaretMovement extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
@@ -116,7 +116,6 @@ export class TwoStepCaretMovement extends Plugin {
 		const view = editor.editing.view;
 		const locale = editor.locale;
 
-		// const twoStepCaretHandler = new TwoStepCaretHandler( model, emitter, attribute );
 		const modelSelection = model.document.selection;
 
 		// Listen to keyboard events and handle the caret movement according to the 2-step caret logic.
@@ -131,11 +130,6 @@ export class TwoStepCaretMovement extends Plugin {
 		//
 		// Find out more in https://github.com/ckeditor/ckeditor5-engine/issues/1301.
 		this.listenTo( view.document, 'keydown', ( evt, data ) => {
-			// Do nothing if the plugin is disabled.
-			// if ( !this.isEnabled ) {
-			// 	return;
-			// }
-
 			// This implementation works only for collapsed selection.
 			if ( !modelSelection.isCollapsed ) {
 				return;
@@ -189,7 +183,6 @@ export class TwoStepCaretMovement extends Plugin {
 		);
 	}
 }
-export default TwoStepCaretMovement;
 
 /**
  * This is a protected helper–class for {@link module:typing/twostepcaretmovement}.

+ 1 - 1
packages/ckeditor5-typing/tests/twostepcaretmovement.js

@@ -9,7 +9,7 @@ import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtest
 import DomEmitterMixin from '@ckeditor/ckeditor5-utils/src/dom/emittermixin';
 import DomEventData from '@ckeditor/ckeditor5-engine/src/view/observer/domeventdata';
 import EventInfo from '@ckeditor/ckeditor5-utils/src/eventinfo';
-import { TwoStepCaretMovement, TwoStepCaretHandler } from '../src/twostepcaretmovement';
+import TwoStepCaretMovement, { TwoStepCaretHandler } from '../src/twostepcaretmovement';
 import Position from '@ckeditor/ckeditor5-engine/src/model/position';
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';