mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
🎨 Disable drag in read-only mode of the editor (#15206)
This commit is contained in:
parent
286223db84
commit
65c7be8dea
1 changed files with 5 additions and 0 deletions
|
|
@ -809,6 +809,11 @@ const dragSame = async (protyle: IProtyle, sourceElements: Element[], targetElem
|
|||
|
||||
export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||
editorElement.addEventListener("dragstart", (event) => {
|
||||
if (protyle.disabled) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
let target = event.target as HTMLElement;
|
||||
if (target.classList.contains("av__gallery-img")) {
|
||||
target = hasClosestByClassName(target, "av__gallery-item") as HTMLElement;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue