mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-19 02:10:04 +08:00
fix(mobile): classic toolbar disappearing when pressing dropdowns
This commit is contained in:
parent
ef9e21147f
commit
c1280be74a
@ -27,18 +27,21 @@ const TPL = `\
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.mobile .classic-toolbar-widget.visible {
|
body.mobile .classic-toolbar-widget.visible {
|
||||||
display: block;
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
height: 50vh;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
background: var(--main-background-color);
|
background: transparent;
|
||||||
z-index: 500;
|
z-index: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.mobile .classic-toolbar-widget .ck.ck-toolbar {
|
body.mobile .classic-toolbar-widget .ck.ck-toolbar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
background-color: var(--main-background-color);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
`;
|
`;
|
||||||
|
@ -228,11 +228,19 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
$classicToolbarWidget.addClass("visible");
|
$classicToolbarWidget.addClass("visible");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Hide the formatting toolbar
|
||||||
this.$editor.on("focusout", (e) => {
|
this.$editor.on("focusout", (e) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (document.activeElement !== this.$editor[0]) {
|
if (document.activeElement === this.$editor[0]) {
|
||||||
$classicToolbarWidget.removeClass("visible");
|
// Editor has been refocused.
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($classicToolbarWidget[0].contains(document.activeElement)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$classicToolbarWidget.removeClass("visible");
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user