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

t/3: Implemented a keystroke to display the toolbar in a collapsed selection #8

Merged
merged 4 commits into from
Jul 20, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/balloontoolbareditorui.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ export default class BalloonToolbarEditorUI {
origin: editor.editing.view,
originFocusTracker: this.focusTracker,
originKeystrokeHandler: editor.keystrokes,
toolbar: contextualToolbar.toolbarView
toolbar: contextualToolbar.toolbarView,
beforeFocus: () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beforeFocus() { ....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, don't you think that beforeFocus callback doing show() is kinda odd? It's hard to read. I had to look into the code to figure out what's going on here.

Copy link
Member

@Reinmar Reinmar Jul 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a couple more minutes this looks reasonable... :D So I'm ok. But beforeFocus() { ... } stays.

return contextualToolbar.show();
},
afterBlur: () => {
contextualToolbar.hide();
}
} );
}

Expand Down