mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 00:16:00 +00:00
theming, menu fixes
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
export let items;
|
||||
|
||||
let isOpened;
|
||||
let openedLabel;
|
||||
|
||||
function handleOpenMenu(element, item) {
|
||||
const rect = element.getBoundingClientRect();
|
||||
@@ -14,11 +15,13 @@
|
||||
const items = item.submenu;
|
||||
$currentDropDownMenu = { left, top, items };
|
||||
isOpened = true;
|
||||
openedLabel = item.text || item.label;
|
||||
}
|
||||
|
||||
$: preparedItems = prepareMenuItems(items, {}, $commandsCustomized);
|
||||
$: if (!$currentDropDownMenu) {
|
||||
isOpened = false;
|
||||
openedLabel = null;
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -26,6 +29,7 @@
|
||||
{#each preparedItems as item}
|
||||
<div
|
||||
class="item"
|
||||
class:opened={openedLabel == (item.text || item.label)}
|
||||
on:click={e => handleOpenMenu(e.target, item)}
|
||||
on:mousemove={e => {
|
||||
if (isOpened) {
|
||||
@@ -62,4 +66,8 @@
|
||||
.item:hover {
|
||||
background: var(--theme-bg-3);
|
||||
}
|
||||
|
||||
.item.opened {
|
||||
background: var(--theme-bg-3);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user