Ver código fonte

Attaching same scroll and resize callback in ImageToolbar.

Szymon Kupś 9 anos atrás
pai
commit
9b196ea497
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      packages/ckeditor5-image/src/imagetoolbar.js

+ 2 - 1
packages/ckeditor5-image/src/imagetoolbar.js

@@ -95,10 +95,11 @@ export default class ImageToolbar extends Plugin {
 				}
 			} );
 
+			const attachToolbarCallback = throttle( attachToolbar, 100 );
+
 			// Check if the toolbar should be displayed each time view is rendered.
 			editor.listenTo( editingView, 'render', () => {
 				const selectedElement = editingView.selection.getSelectedElement();
-				const attachToolbarCallback = throttle( attachToolbar, 100 );
 
 				if ( selectedElement && isImageWidget( selectedElement ) ) {
 					attachToolbar();