mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-11-10 11:51:36 +08:00
feat(mobile): display editor toolbar only when focused
This commit is contained in:
parent
795f715852
commit
3913088451
@ -23,6 +23,11 @@ const TPL = `\
|
||||
}
|
||||
|
||||
body.mobile .classic-toolbar-widget {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.mobile .classic-toolbar-widget.visible {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
|
||||
@ -207,6 +207,16 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
|
||||
$classicToolbarWidget.empty();
|
||||
$classicToolbarWidget[0].appendChild(editor.ui.view.toolbar.element);
|
||||
|
||||
if (utils.isMobile()) {
|
||||
this.$editor.on("focus", (e) => {
|
||||
$classicToolbarWidget.addClass("visible");
|
||||
});
|
||||
|
||||
this.$editor.on("focusout", (e) => {
|
||||
$classicToolbarWidget.removeClass("visible");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
editor.model.document.on('change:data', () => this.spacedUpdate.scheduleUpdate());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user