mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
feat(mobile): reposition dropdowns to point up instead of down
This commit is contained in:
parent
e23b2f3ddd
commit
326c409e47
@ -252,6 +252,23 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
|
|
||||||
if (utils.isMobile()) {
|
if (utils.isMobile()) {
|
||||||
$classicToolbarWidget.addClass("visible");
|
$classicToolbarWidget.addClass("visible");
|
||||||
|
|
||||||
|
// Reposition all dropdowns to point upwards instead of downwards.
|
||||||
|
// See https://ckeditor.com/docs/ckeditor5/latest/examples/framework/bottom-toolbar-editor.html for more info.
|
||||||
|
const toolbarView = editor.ui.view.toolbar;
|
||||||
|
for (const item of toolbarView.items) {
|
||||||
|
if (!("panelView" in item)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
item.on("change:isOpen", () => {
|
||||||
|
if ( !item.isOpen ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
item.panelView.position = item.panelView.position.replace("s", "n");
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user