Simplify Code
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2372>
This commit is contained in:
parent
e258e6f12b
commit
0cbe567ac1
|
@ -111,11 +111,11 @@ const openMenu = () => {
|
||||||
const rightOverflow = viewportOffset.right - viewportWidth
|
const rightOverflow = viewportOffset.right - viewportWidth
|
||||||
const leftOverflow = -viewportOffset.left
|
const leftOverflow = -viewportOffset.left
|
||||||
|
|
||||||
if (rightOverflow > 0) {
|
menu.css({
|
||||||
menu.css({ cssText: `left: ${-rightOverflow - 5}px !important;` })
|
cssText: rightOverflow > 0
|
||||||
} else if (leftOverflow > 0) {
|
? `left: ${-rightOverflow - 5}px !important;`
|
||||||
menu.css({ cssText: `right: -${leftOverflow + 5}px !important;` })
|
: `right: ${-leftOverflow + 5}px !important;`
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue