Преглед на файлове

Integrated FocusManager with the editor.

Oskar Wrobel преди 9 години
родител
ревизия
f841e6c4e3
променени са 2 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 8 0
      packages/ckeditor5-core/src/editor/editor.js
  2. 2 0
      packages/ckeditor5-core/tests/editor/editor.js

+ 8 - 0
packages/ckeditor5-core/src/editor/editor.js

@@ -9,6 +9,7 @@ import PluginCollection from '../plugincollection.js';
 import Locale from '../../utils/locale.js';
 import DataController from '../../engine/datacontroller.js';
 import Document from '../../engine/model/document.js';
+import FocusManager from '../../utils/focusmanager.js';
 
 import CKEditorError from '../../utils/ckeditorerror.js';
 import isArray from '../../utils/lib/lodash/isArray.js';
@@ -83,6 +84,13 @@ export default class Editor {
 		 */
 		this.data = new DataController( this.document );
 
+		/**
+		 * Keeps information about editor focus.
+		 *
+		 * @member {utils.FocusManager} core.editor.Editor#focusManager
+		 */
+		this.focusManager = new FocusManager();
+
 		/**
 		 * Instance of the {@link engine.EditingController editing controller}.
 		 *

+ 2 - 0
packages/ckeditor5-core/tests/editor/editor.js

@@ -11,6 +11,7 @@ import Editor from '/ckeditor5/core/editor/editor.js';
 import Plugin from '/ckeditor5/core/plugin.js';
 import Config from '/ckeditor5/utils/config.js';
 import PluginCollection from '/ckeditor5/core/plugincollection.js';
+import FocusManager from '/ckeditor5/utils/focusmanager.js';
 
 const pluginClasses = {};
 
@@ -28,6 +29,7 @@ describe( 'Editor', () => {
 
 			expect( editor.config ).to.be.an.instanceof( Config );
 			expect( editor.commands ).to.be.an.instanceof( Map );
+			expect( editor.focusManager ).to.instanceOf( FocusManager );
 
 			expect( editor.plugins ).to.be.an.instanceof( PluginCollection );
 			expect( getPlugins( editor ) ).to.be.empty;