UX: avoid footer admin menu from overflowing top (#24149)
This commit is contained in:
parent
68728806c1
commit
2e06cc1248
|
@ -1,5 +1,6 @@
|
|||
import $ from "jquery";
|
||||
import { h } from "virtual-dom";
|
||||
import { headerOffset } from "discourse/lib/offset-calculator";
|
||||
import { applyDecorators, createWidget } from "discourse/widgets/widget";
|
||||
|
||||
createWidget("admin-menu-button", {
|
||||
|
@ -328,6 +329,7 @@ export default createWidget("topic-admin-menu", {
|
|||
buildAttributes(attrs) {
|
||||
let { top, left, outerHeight } = attrs.position;
|
||||
const position = this.site.mobileView ? "fixed" : "absolute";
|
||||
const approxMenuHeight = attrs.actionButtons.length * 42;
|
||||
|
||||
if (attrs.rightSide) {
|
||||
return;
|
||||
|
@ -343,6 +345,11 @@ export default createWidget("topic-admin-menu", {
|
|||
bottom = bottom - (documentHeight - mainHeight) - outerHeight;
|
||||
}
|
||||
|
||||
if (top < approxMenuHeight) {
|
||||
bottom =
|
||||
bottom - (approxMenuHeight - outerHeight - top) - headerOffset();
|
||||
}
|
||||
|
||||
if (this.site.mobileView) {
|
||||
bottom = 50;
|
||||
left = 0;
|
||||
|
|
Loading…
Reference in New Issue