style: Remove unneeded nesting

This commit is contained in:
Georg krause 2023-04-26 14:55:25 +02:00
parent 30adbf7c0b
commit 90dddfd86f
1 changed files with 10 additions and 10 deletions

View File

@ -105,7 +105,8 @@ const openMenu = () => {
// little magic to ensure the menu is always visible in the viewport
// By default, try to display it on the right if there is enough room
const menu = dropdown.value.find('.menu')
if (!menu.classList.includes('visible')) {
if (menu.classList.includes('visible')) return
const viewportOffset = menu.get(0)?.getBoundingClientRect() ?? { right: 0, left: 0 }
const viewportWidth = document.documentElement.clientWidth
const rightOverflow = viewportOffset.right - viewportWidth
@ -117,7 +118,6 @@ const openMenu = () => {
menu.css({ cssText: `right: -${leftOverflow + 5}px !important;` })
}
}
}
</script>
<template>