Skip to content

Commit

Permalink
🎨 #10730
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Sep 22, 2024
1 parent 2cf0b09 commit d081e3c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/layout/Wnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export class Wnd {
this.headersElement.parentElement.addEventListener("drop", function (event: DragEvent & {
target: HTMLElement
}) {
headerDragCounter = 0;
const it = this as HTMLElement;
if (event.dataTransfer.types.includes(Constants.SIYUAN_DROP_FILE)) {
// 文档树拖拽
Expand Down
1 change: 1 addition & 0 deletions app/src/layout/dock/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ export class Files extends Model {
counter++;
});
this.element.addEventListener("drop", async (event: DragEvent & { target: HTMLElement }) => {
counter = 0;
const newElement = this.element.querySelector(".dragover, .dragover__bottom, .dragover__top");
if (!newElement) {
return;
Expand Down
1 change: 1 addition & 0 deletions app/src/protyle/render/av/blockAttr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
});
});
element.addEventListener("drop", () => {
counter = 0;
window.siyuan.dragElement.style.opacity = "";
const targetElement = element.querySelector(".dragover__bottom, .dragover__top") as HTMLElement;
if (targetElement && dragBlockElement) {
Expand Down
1 change: 1 addition & 0 deletions app/src/protyle/render/av/openMenuPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export const openMenuPanel = (options: {
return;
});
avPanelElement.addEventListener("drop", (event) => {
counter = 0;
if (!window.siyuan.dragElement) {
event.preventDefault();
event.stopPropagation();
Expand Down
1 change: 1 addition & 0 deletions app/src/protyle/util/editorCommonEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
document.onmouseup = null;
});
editorElement.addEventListener("drop", async (event: DragEvent & { target: HTMLElement }) => {
counter = 0;
if (protyle.disabled || event.dataTransfer.getData(Constants.SIYUAN_DROP_EDITOR)) {
// 只读模式/编辑器内选中文字拖拽
event.preventDefault();
Expand Down

0 comments on commit d081e3c

Please sign in to comment.