Skip to content

Commit

Permalink
chore: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Feb 24, 2024
1 parent d1f9ae3 commit a6f230a
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/sidebar/components/panel.tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@
AnimatedTabList(:panel="panel")
.tab-preview(
v-if="Tabs.reactive.inlinePreviewPinnedImg"
:style="{ '--bgi': Tabs.reactive.inlinePreviewPinnedImg }"
@mouseenter="onPreviewMouseEnter"
@mouseleave="onPreviewMouseLeave")
:style="{ '--bgi': Tabs.reactive.inlinePreviewPinnedImg }")
template(
v-if="Settings.state.previewTabs && (Settings.state.previewTabsMode === 'i' || Settings.state.previewTabsPageModeFallback === 'i')"
v-for="id in panel.reactive.visibleTabIds"
:key="id")
TabComponent(:tabId="id")
.tab-preview(
v-if="Tabs.reactive.inlinePreviewTabId === id"
:style="{ '--bgi': Tabs.byId[id]?.previewImg }"
@mouseenter="onPreviewMouseEnter"
@mouseleave="onPreviewMouseLeave")
:style="{ '--bgi': Tabs.byId[id]?.previewImg }")
template(v-else)
TabComponent(v-for="id in panel.reactive.visibleTabIds" :key="id" :tabId="id")
NewTabBar(
Expand Down Expand Up @@ -246,16 +242,4 @@ const onWheel = Mouse.getWheelDebouncer(WheelDirection.Vertical, (e: WheelEvent)
function onMouseLeave() {
if (Tabs.blockedScrollPosition) Tabs.resetScrollRetainer(props.panel)
}
function onPreviewMouseEnter() {
clearTimeout(Preview.state.mouseEnterTimeout)
clearTimeout(Preview.state.mouseLeaveTimeout)
}
function onPreviewMouseLeave() {
clearTimeout(Preview.state.mouseLeaveTimeout)
Preview.state.mouseLeaveTimeout = setTimeout(() => {
Preview.closePreviewInline()
}, 32)
}
</script>

0 comments on commit a6f230a

Please sign in to comment.