mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 01:18:44 +02:00
fix positioning of attr detail popup for smaller windows
This commit is contained in:
parent
8259b4a32c
commit
268910ed3b
@ -29,7 +29,8 @@ export default class DesktopExtraWindowLayout {
|
||||
.child(new TitleBarButtonsWidget()))
|
||||
.child(new FlexContainer('row')
|
||||
.collapsible()
|
||||
.child(new FlexContainer('column').id('center-pane').css('flex-grow', '1')
|
||||
.filling()
|
||||
.child(new FlexContainer('column').id('center-pane').filling()
|
||||
.child(new FlexContainer('row').class('title-row')
|
||||
.overflowing()
|
||||
.cssBlock('.title-row > * { margin: 5px 5px 0 5px; }')
|
||||
|
@ -445,7 +445,28 @@ export default class AttributeDetailWidget extends TabAwareWidget {
|
||||
|
||||
const offset = this.parent.$widget.offset();
|
||||
|
||||
this.$widget.css("left", x - offset.left - this.$widget.outerWidth() / 2);
|
||||
const left = x - offset.left - this.$widget.outerWidth() / 2;
|
||||
|
||||
if (left < 0) {
|
||||
this.$widget
|
||||
.css("left", "10px")
|
||||
.css("right", "");
|
||||
}
|
||||
else {
|
||||
const right = left + this.$widget.outerWidth();
|
||||
|
||||
if (right > $(window).width() - 10) {
|
||||
this.$widget
|
||||
.css("left", "")
|
||||
.css("right", "10px");
|
||||
}
|
||||
else {
|
||||
this.$widget
|
||||
.css("left", left)
|
||||
.css("right", "");
|
||||
}
|
||||
}
|
||||
|
||||
this.$widget.css("top", y - offset.top + 70);
|
||||
|
||||
// so that the detail window always fits
|
||||
|
Loading…
x
Reference in New Issue
Block a user