效果是禁用这个功能:
JS 代码片段:
// 禁用 Shift+悬浮 打开反链浮窗 JS片段
(function() {
// 监听 keydown 事件,捕获阶段
// 阻止这里的调用 https://github.com/siyuan-note/siyuan/blob/4366e726ef4174d397ebb56c1a49307ef5b9ab69/app/src/boot/globalEvent/commonHotkey.ts#L183
document.addEventListener('keydown', function(event) {
// 检查是否按下 Shift 键
if (event.shiftKey) {
// 获取鼠标下方的元素
const elementUnderMouse = document.elementFromPoint(window.siyuan.coordinates.clientX, window.siyuan.coordinates.clientY);
// 检查元素是否包含 data-type="block-ref" 属性
if (elementUnderMouse && elementUnderMouse.getAttribute('data-type') === 'block-ref') {
// 阻止事件传递
event.stopPropagation();
}
}
}, true);
// 监听 mouseover 事件,捕获阶段
// 阻止这里的调用 https://github.com/siyuan-note/siyuan/blob/4366e726ef4174d397ebb56c1a49307ef5b9ab69/app/src/block/popover.ts#L163
document.addEventListener('mouseover', function(event) {
// 检查事件元素是否包含 data-type="block-ref" 属性
if (event.target.getAttribute('data-type') === 'block-ref') {
// 将 window.siyuan.shiftIsPressed 赋值为 false
window.siyuan.shiftIsPressed = false;
}
}, true);
})();
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于