fix scrollbars being hidden when sidebar is disabled on firefox

+ rename components, to follow vue style guides
This commit is contained in:
geoffrey45
2022-09-28 08:35:26 +03:00
committed by Mungai Njoroge
parent 62b9aa7a3e
commit 6fb9c0fc4a
24 changed files with 34 additions and 49 deletions
+91
View File
@@ -0,0 +1,91 @@
<template>
<div
class="context-menu rounded shadow-lg"
:class="[
{ 'context-menu-visible': context.visible },
{ 'context-normalizedX': context.normalizedX },
{
'context-normalizedY': context.normalizedY,
},
{
'context-many-kids': context.hasManyChildren(),
},
]"
id="context-menu"
:style="{
left: context.x + 'px',
top: context.y + 'px',
}"
>
<ContextItem
class="context-item"
v-for="option in context.options"
:key="option.label"
:class="[{ critical: option.critical }, option.type]"
:option="option"
@click="option.action && option.action()"
/>
</div>
</template>
<script setup lang="ts">
import useContextStore from "../stores/context";
import ContextItem from "./Contextmenu/ContextItem.vue";
const context = useContextStore();
</script>
<style lang="scss">
.context-menu {
position: fixed;
top: 0;
left: 0;
width: 12rem;
z-index: 10000 !important;
transform: scale(0);
padding: $small 0;
background: $context;
transform-origin: top left;
font-size: 0.875rem;
.separator {
height: 1px;
padding: 0;
}
.critical {
&:hover {
background-color: $red;
}
}
}
.context-menu-visible {
transform: scale(1);
}
.context-normalizedX {
.more {
transform: rotate(180deg);
}
.context-item > .children {
left: -13rem;
transform-origin: center right;
}
}
.context-normalizedY {
.context-item > .children {
transform-origin: bottom right;
top: -0.5rem;
}
}
.context-many-kids {
.context-item > .children {
overflow-y: auto;
}
}
</style>