Simplify Code

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2372>
This commit is contained in:
Kasper Seweryn 2023-04-26 12:54:43 +00:00
parent e258e6f12b
commit 0cbe567ac1
1 changed files with 5 additions and 5 deletions

View File

@ -111,11 +111,11 @@ const openMenu = () => {
const rightOverflow = viewportOffset.right - viewportWidth
const leftOverflow = -viewportOffset.left
if (rightOverflow > 0) {
menu.css({ cssText: `left: ${-rightOverflow - 5}px !important;` })
} else if (leftOverflow > 0) {
menu.css({ cssText: `right: -${leftOverflow + 5}px !important;` })
}
menu.css({
cssText: rightOverflow > 0
? `left: ${-rightOverflow - 5}px !important;`
: `right: ${-leftOverflow + 5}px !important;`
})
}
}
</script>