mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe
synced 2025-04-30 19:19:29 +08:00
Make moderation popover not exit confines of modal
thanks twinkle it's not a solution i'm proud of and ideally it would behave fine but i think i've just reached a limitation of css here grumble grumble
This commit is contained in:
parent
d09cfe76db
commit
a4173e0900
3 changed files with 15 additions and 2 deletions
|
@ -36,6 +36,11 @@
|
||||||
|
|
||||||
.user-moderation {
|
.user-moderation {
|
||||||
padding-top: 0.6em;
|
padding-top: 0.6em;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.popover {
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.basic-user-card {
|
.basic-user-card {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
class="moderation-tools-popover"
|
class="moderation-tools-popover"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
:offset="{ y: 5 }"
|
:offset="{ y: 5 }"
|
||||||
|
:noCenter="extended"
|
||||||
@show="setToggled(true)"
|
@show="setToggled(true)"
|
||||||
@close="setToggled(false)"
|
@close="setToggled(false)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -31,7 +31,11 @@ const Popover = {
|
||||||
|
|
||||||
// If true, subtract padding when calculating position for the popover,
|
// If true, subtract padding when calculating position for the popover,
|
||||||
// use it when popover offset looks to be different on top vs bottom.
|
// use it when popover offset looks to be different on top vs bottom.
|
||||||
removePadding: Boolean
|
removePadding: Boolean,
|
||||||
|
|
||||||
|
// If true, do not center the popover under the button that called it,
|
||||||
|
// instead aligning it to the right.
|
||||||
|
noCenter: Boolean
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
@ -121,7 +125,10 @@ const Popover = {
|
||||||
: yOffset
|
: yOffset
|
||||||
|
|
||||||
const xOffset = (this.offset && this.offset.x) || 0
|
const xOffset = (this.offset && this.offset.x) || 0
|
||||||
const translateX = anchorWidth * 0.5 - content.offsetWidth * 0.5 + horizOffset + xOffset
|
let translateX = translateX = anchorWidth * 0.5 - content.offsetWidth * 0.5 + horizOffset + xOffset
|
||||||
|
if (this.noCenter) {
|
||||||
|
translateX = 0
|
||||||
|
}
|
||||||
|
|
||||||
// Note, separate translateX and translateY avoids blurry text on chromium,
|
// Note, separate translateX and translateY avoids blurry text on chromium,
|
||||||
// single translate or translate3d resulted in blurry text.
|
// single translate or translate3d resulted in blurry text.
|
||||||
|
|
Loading…
Reference in a new issue