fix positioning of attr detail popup for smaller windows

This commit is contained in:
zadam 2020-08-28 15:38:04 +02:00
parent 8259b4a32c
commit 268910ed3b
2 changed files with 24 additions and 2 deletions

View File

@ -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; }')

View File

@ -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