fix context menu alignements in controls
This commit is contained in:
parent
28d4765a6d
commit
9f1c03e0ac
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
|
||||
<div class="controls__menu">
|
||||
<Popper>
|
||||
<Popper needOffset={false}>
|
||||
<button
|
||||
slot="btn"
|
||||
class="controls__menuBtn"
|
||||
|
@ -19,6 +19,7 @@ import detectOverflow from '@popperjs/core/lib/utils/detectOverflow.js';
|
||||
let btn
|
||||
let content
|
||||
let isActive = false
|
||||
export let needOffset
|
||||
|
||||
export function open () {
|
||||
isActive = true
|
||||
@ -39,7 +40,11 @@ onMount(() => {
|
||||
name: 'offset',
|
||||
options: {
|
||||
offset: ({ reference, popper }) => {
|
||||
return [-10, -reference.width - 5];
|
||||
if (needOffset) {
|
||||
return [-10, -reference.width - 5];
|
||||
} else {
|
||||
return [5, -reference.width - 5];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{#if $next}
|
||||
<Popper>
|
||||
<Popper needOffset={true}>
|
||||
<button slot="btn" class="track__menu" aria-label="track menu"><IconMenu></IconMenu></button>
|
||||
<div slot="content" class="contextMenu__list">
|
||||
<ContextMenu track={$next}></ContextMenu>
|
||||
@ -36,7 +36,7 @@
|
||||
<DistanceDate date={track.referer.date} />
|
||||
</div>
|
||||
</div>
|
||||
<Popper>
|
||||
<Popper needOffset={true}>
|
||||
<button slot="btn" class="track__menu" aria-label="track menu"><IconMenu></IconMenu></button>
|
||||
<div slot="content" class="contextMenu__list">
|
||||
<ContextMenu track={track}></ContextMenu>
|
||||
|
Loading…
x
Reference in New Issue
Block a user