Skip to content

Commit

Permalink
🛠移除链接 popover 功能
Browse files Browse the repository at this point in the history
- 删除了处理鼠标右键点击和悬停事件的代码块
- 移除了处理移动端点击和长按事件的代码块
- 简化了链接点击事件的处理逻辑
  • Loading branch information
0xcaffebabe committed Dec 20, 2024
1 parent c1e5102 commit d5caf8b
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/pages/doc/DocPageEventManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,39 +69,6 @@ class DocPageEventManager {
return false
}
};
if (!this.isMobile) {
const action = (e: MouseEvent) => {
const originLink = a.getAttribute('origin-link')!;
(this.getRef('linkPopover') as InstanceType<typeof LinkPopover>).show(originLink, e.clientX, e.clientY);
e.preventDefault();
e.stopPropagation();
}
a.addEventListener('contextmenu', (e: MouseEvent) => {
action(e)
return false;
});
a.addEventListener('mouseover', (e: MouseEvent) => {
action(e)
return false
})
}else {
a.addEventListener('click', e => {
e.stopPropagation()
e.preventDefault()
})
const originLink = a.getAttribute('origin-link')!;
TouchUtils.onPress(a, (duration) => {
if (duration <= 500) {
this.docPageInstance.$router.push(a.getAttribute('href')!.replace('#/', ''))
console.log('click')
return;
}
if (duration > 500) {
(this.getRef('linkPopover') as InstanceType<typeof LinkPopover>).show(originLink, window.innerWidth / 10, 100);
return
}
})
}
}
// 外部链接
for(let i = 0;i < outterLinkList.length;i++){
Expand Down

0 comments on commit d5caf8b

Please sign in to comment.