Browse Source

Merge t/ckeditor5-engine/1208

Other: Aligned code to the changes in the engine.
Piotrek Koszuliński 8 years ago
parent
commit
a2abd508f1
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/ckeditor5-widget/src/widget.js

+ 4 - 4
packages/ckeditor5-widget/src/widget.js

@@ -321,14 +321,14 @@ export default class Widget extends Plugin {
 	 * @returns {module:engine/model/element~Element|null}
 	 */
 	_getObjectElementNextToSelection( forward ) {
-		const schema = this.editor.model.schema;
-		const modelSelection = this.editor.model.document.selection;
-		const dataController = this.editor.data;
+		const model = this.editor.model;
+		const schema = model.schema;
+		const modelSelection = model.document.selection;
 
 		// Clone current selection to use it as a probe. We must leave default selection as it is so it can return
 		// to its current state after undo.
 		const probe = ModelSelection.createFromSelection( modelSelection );
-		dataController.modifySelection( probe, { direction: forward ? 'forward' : 'backward' } );
+		model.modifySelection( probe, { direction: forward ? 'forward' : 'backward' } );
 		const objectElement = forward ? probe.focus.nodeBefore : probe.focus.nodeAfter;
 
 		if ( objectElement instanceof ModelElement && schema.objects.has( objectElement.name ) ) {