From c6948e5cf80bf7f808f2e889b53aac02d01334e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Kup=C5=9B?= Date: Fri, 30 Dec 2016 11:54:05 +0100 Subject: [PATCH] Attaching same scroll and resize callback in ImageToolbar. --- src/imagetoolbar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imagetoolbar.js b/src/imagetoolbar.js index 8461cc90..dd8d2eca 100644 --- a/src/imagetoolbar.js +++ b/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();