mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-11-11 12:41:43 +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 {
|
body.mobile .classic-toolbar-widget {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.mobile .classic-toolbar-widget.visible {
|
||||||
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
@ -207,6 +207,16 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
|
|
||||||
$classicToolbarWidget.empty();
|
$classicToolbarWidget.empty();
|
||||||
$classicToolbarWidget[0].appendChild(editor.ui.view.toolbar.element);
|
$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());
|
editor.model.document.on('change:data', () => this.spacedUpdate.scheduleUpdate());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user