Browse Source

[frontend] Close the sidebar tooltip menu after click

Johan Ahlen 4 years ago
parent
commit
55afcf46ee

+ 5 - 0
desktop/core/src/desktop/js/components/sidebar/AccordionItem.vue

@@ -82,6 +82,7 @@
       :visible="isCollapsed"
       :style="tooltipStyle"
       role="tooltip"
+      @click="onTooltipClick"
     >
       <div
         v-if="isUserMenu"
@@ -254,6 +255,10 @@
       this.isTooltipScrolled = (event.target as HTMLElement).scrollTop > 0;
     }
 
+    onTooltipClick(): void {
+      this.tooltip = null;
+    }
+
     openTooltip(el: HTMLElement, fromKeyboard?: boolean): void {
       const rect = el.getBoundingClientRect();
       // maxHeight is needed for the edge-cases where the accordion tooltip content would

+ 1 - 0
desktop/core/src/desktop/js/components/sidebar/BaseNavigationItemTooltip.vue

@@ -20,6 +20,7 @@
   <div
     class="sidebar-sidebar-item-tooltip"
     :class="{ 'sidebar-sidebar-item-tooltip-visible': visible }"
+    @click="$emit('click')"
   >
     <slot />
   </div>