feat: get context menu state variable directly in showContextMenu instead of requiring a context menu object as a parameter

This commit is contained in:
SauceyRed 2025-08-16 15:06:31 +02:00
commit 1d21d476d5
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7
4 changed files with 26 additions and 27 deletions

View file

@ -1,5 +1,5 @@
<template>
<div ref="resizableSidebar" class="resizable-sidebar" @contextmenu="showContextMenu($event, contextMenu, menuSections)"
<div ref="resizableSidebar" class="resizable-sidebar"
:style="{
'width': storedWidth ? storedWidth : props.width,
'min-width': props.minWidth,
@ -8,13 +8,15 @@
'border-top': props.borderSides?.includes('top') ? borderStyling : undefined,
'border-bottom': props.borderSides?.includes('bottom') ? borderStyling : undefined,
}">
<div v-if="props.borderSides != 'right'" class="width-resizer-bar">
<div v-if="props.borderSides != 'right'" class="width-resizer-bar"
@contextmenu="showContextMenu($event, menuSections)">
<div ref="widthResizer" class="width-resizer"></div>
</div>
<div class="sidebar-content">
<slot />
</div>
<div v-if="props.borderSides == 'right'" class="width-resizer-bar">
<div v-if="props.borderSides == 'right'" class="width-resizer-bar"
@contextmenu="showContextMenu($event, menuSections)">
<div ref="widthResizer" class="width-resizer"></div>
</div>
</div>
@ -31,8 +33,6 @@ const resizableSidebar = ref<HTMLDivElement>();
const widthResizer = ref<HTMLDivElement>();
const storedWidth = ref<string>();
const contextMenu = useState<ContextMenuInterface>("contextMenu");
const menuSections: ContextMenuSection[] = [{
items: [
{