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

Used EditorUI#update instead of ViewDocument#render to pin panel.

Oskar Wróbel 7 лет назад
Родитель
Сommit
bd035fee7a

+ 1 - 1
packages/ckeditor5-editor-inline/src/inlineeditorui.js

@@ -49,7 +49,7 @@ export default class InlineEditorUI extends EditorUI {
 		}
 
 		// https://github.com/ckeditor/ckeditor5-editor-inline/issues/4
-		view.listenTo( editor.editing.view, 'render', () => {
+		view.listenTo( editor.ui, 'update', () => {
 			// Don't pin if the panel is not already visible. It prevents the panel
 			// showing up when there's no focus in the UI.
 			if ( view.panel.isVisible ) {

+ 3 - 3
packages/ckeditor5-editor-inline/tests/inlineeditorui.js

@@ -80,17 +80,17 @@ describe( 'InlineEditorUI', () => {
 			} );
 
 			// https://github.com/ckeditor/ckeditor5-editor-inline/issues/4
-			it( 'pin() is called on editor.editable.view#render', () => {
+			it( 'pin() is called on editor.ui#update', () => {
 				const spy = sinon.stub( view.panel, 'pin' );
 
 				view.panel.hide();
 
-				editor.editing.view.render();
+				editor.ui.fire( 'update' );
 				sinon.assert.notCalled( spy );
 
 				view.panel.show();
 
-				editor.editing.view.render();
+				editor.ui.fire( 'update' );
 				sinon.assert.calledOnce( spy );
 				sinon.assert.calledWithExactly( spy, {
 					target: view.editableElement,