mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 23:21:23 +08:00
This commit is contained in:
parent
a7d3e8a0c8
commit
e91ae262ec
@ -715,6 +715,8 @@ export class Toolbar {
|
||||
pingElement.classList.add("block__icon--active");
|
||||
pingElement.setAttribute("aria-label", window.siyuan.languages.unpin);
|
||||
}
|
||||
event.preventDefault()
|
||||
event.stopPropagation();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -772,7 +774,7 @@ export class Toolbar {
|
||||
dragBgElement.classList.remove("fn__none");
|
||||
const x = event.clientX - parseInt(this.subElement.style.left);
|
||||
const y = event.clientY - parseInt(this.subElement.style.top);
|
||||
setTimeout(() => {
|
||||
// setTimeout(() => {
|
||||
// windows 需等待 dragBgElement 显示后才可以进行 move https://github.com/siyuan-note/siyuan/issues/2950
|
||||
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
|
||||
let positionX = moveEvent.clientX - x;
|
||||
@ -787,8 +789,10 @@ export class Toolbar {
|
||||
this.subElement.style.top = Math.max(positionY, Constants.SIZE_TOOLBAR_HEIGHT) + "px";
|
||||
this.subElement.firstElementChild.setAttribute("data-drag", "true");
|
||||
};
|
||||
|
||||
// });
|
||||
console.log("onmousedown");
|
||||
documentSelf.onmouseup = () => {
|
||||
console.log("onmouseup");
|
||||
this.subElement.style.userSelect = "auto";
|
||||
documentSelf.onmousemove = null;
|
||||
documentSelf.onmouseup = null;
|
||||
@ -797,7 +801,7 @@ export class Toolbar {
|
||||
documentSelf.onselect = null;
|
||||
dragBgElement.classList.add("fn__none");
|
||||
};
|
||||
});
|
||||
|
||||
return;
|
||||
});
|
||||
const textElement = this.subElement.querySelector(".b3-text-field") as HTMLTextAreaElement;
|
||||
|
Loading…
Reference in New Issue
Block a user