Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Attaching same scroll and resize callback in ImageToolbar.
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonkups committed Jan 2, 2017
1 parent 7a2b3a0 commit c6948e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/imagetoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c6948e5

Please sign in to comment.