8
0
Эх сурвалжийг харах

Merge pull request #30 from ckeditor/t/29

t/29: Passed the editable element as a limiter to StickyToolbarView constru…
Piotrek Koszuliński 9 жил өмнө
parent
commit
6a0401607c

+ 9 - 0
packages/ckeditor5-editor-classic/src/classiceditorui.js

@@ -45,6 +45,15 @@ export default class ClassicEditorUI extends BoxedEditorUI {
 		this.editable = this._createEditableUI();
 	}
 
+	/**
+	 * @inheritDoc
+	 */
+	init() {
+		this.toolbar.model.set( 'limiterElement', this.editor.ui.view.element );
+
+		return super.init();
+	}
+
 	/**
 	 * The editing host.
 	 *

+ 8 - 0
packages/ckeditor5-editor-classic/tests/classiceditorui.js

@@ -68,6 +68,14 @@ describe( 'ClassicEditorUI', () => {
 
 			expect( editorUI.init() ).to.be.instanceof( Promise );
 		} );
+
+		it( 'sets toolbar.model#limiterElement', ( done ) => {
+			return editorUI.init().then( () => {
+				expect( editorUI.toolbar.model.limiterElement ).to.equal( editorUI.view.element );
+
+				done();
+			} );
+		} );
 	} );
 
 	describe( '_createToolbar', () => {