Browse Source

feat: add tooltip to zoom buttons

Ahmad Kholid 3 years ago
parent
commit
2e08aeaee9
1 changed files with 18 additions and 3 deletions
  1. 18 3
      src/components/newtab/workflow/WorkflowBuilder.vue

+ 18 - 3
src/components/newtab/workflow/WorkflowBuilder.vue

@@ -7,15 +7,27 @@
   >
   >
     <slot></slot>
     <slot></slot>
     <div class="absolute z-10 p-4 bottom-0 left-0">
     <div class="absolute z-10 p-4 bottom-0 left-0">
-      <button class="p-2 rounded-lg bg-white mr-2" @click="editor.zoom_reset()">
+      <button
+        v-tooltip.group="'Reset zoom'"
+        class="p-2 rounded-lg bg-white mr-2"
+        @click="editor.zoom_reset()"
+      >
         <v-remixicon name="riFullscreenLine" />
         <v-remixicon name="riFullscreenLine" />
       </button>
       </button>
       <div class="rounded-lg bg-white inline-block">
       <div class="rounded-lg bg-white inline-block">
-        <button class="p-2 rounded-lg relative z-10" @click="editor.zoom_out()">
+        <button
+          v-tooltip.group="'Zoom out'"
+          class="p-2 rounded-lg relative z-10"
+          @click="editor.zoom_out()"
+        >
           <v-remixicon name="riSubtractLine" />
           <v-remixicon name="riSubtractLine" />
         </button>
         </button>
         <hr class="h-6 border-r inline-block" />
         <hr class="h-6 border-r inline-block" />
-        <button class="p-2 rounded-lg" @click="editor.zoom_in()">
+        <button
+          v-tooltip.group="'Zoom in'"
+          class="p-2 rounded-lg"
+          @click="editor.zoom_in()"
+        >
           <v-remixicon name="riAddLine" />
           <v-remixicon name="riAddLine" />
         </button>
         </button>
       </div>
       </div>
@@ -27,6 +39,7 @@
 import { onMounted, shallowRef, getCurrentInstance } from 'vue';
 import { onMounted, shallowRef, getCurrentInstance } from 'vue';
 import emitter from 'tiny-emitter/instance';
 import emitter from 'tiny-emitter/instance';
 import { tasks } from '@/utils/shared';
 import { tasks } from '@/utils/shared';
+import { useGroupTooltip } from '@/composable/groupTooltip';
 import drawflow from '@/lib/drawflow';
 import drawflow from '@/lib/drawflow';
 
 
 export default {
 export default {
@@ -38,6 +51,8 @@ export default {
   },
   },
   emits: ['load', 'deleteBlock'],
   emits: ['load', 'deleteBlock'],
   setup(props, { emit }) {
   setup(props, { emit }) {
+    useGroupTooltip();
+
     const editor = shallowRef(null);
     const editor = shallowRef(null);
 
 
     function dropHandler({ dataTransfer, clientX, clientY }) {
     function dropHandler({ dataTransfer, clientX, clientY }) {