This commit is contained in:
Vanessa 2022-11-08 19:25:07 +08:00
parent 0f97325d51
commit 6a143c699f
5 changed files with 9 additions and 9 deletions

View file

@ -202,7 +202,7 @@ export class Files extends Model {
}
target = target.parentElement;
}
})
});
this.element.addEventListener("click", (event) => {
if (event.detail !== 1) {
setPanelFocus(this.element.parentElement);
@ -319,14 +319,14 @@ export class Files extends Model {
selectElements = [liElement];
}
let ids = "";
const ghostElement = document.createElement("ul")
const ghostElement = document.createElement("ul");
selectElements.forEach((item: HTMLElement) => {
ghostElement.append(item.cloneNode(true));
item.style.opacity = "0.1";
ids += (item.getAttribute("data-node-id") || "") + ",";
});
ghostElement.setAttribute("style", `width: 219px;position: fixed;top:-${selectElements.length * 30}px`)
ghostElement.setAttribute("class", "b3-list b3-list--background")
ghostElement.setAttribute("style", `width: 219px;position: fixed;top:-${selectElements.length * 30}px`);
ghostElement.setAttribute("class", "b3-list b3-list--background");
document.body.append(ghostElement);
event.dataTransfer.setDragImage(ghostElement, 16, 16);
event.dataTransfer.setData(Constants.SIYUAN_DROP_FILE, ids);
@ -335,7 +335,7 @@ export class Files extends Model {
window.siyuan.dragElement.innerText = ids;
setTimeout(() => {
ghostElement.remove();
})
});
}
});
this.element.addEventListener("dragend", () => {

View file

@ -23,7 +23,7 @@ export const showKeyboardToolbar = (bottom = 0) => {
toolbarElement.style.bottom = bottom + "px";
setTimeout(() => {
const contentElement = window.siyuan.mobileEditor.protyle.contentElement
const contentElement = window.siyuan.mobileEditor.protyle.contentElement;
const cursorTop = getSelectionPosition(contentElement).top - contentElement.getBoundingClientRect().top;
if (cursorTop < window.innerHeight - 96) {
return;

View file

@ -105,7 +105,7 @@ export class Toolbar {
this.range.collapse(false);
} else if (event.key === "ArrowUp") {
this.range = setFirstNodeRange(getContenteditableElement(endElement), range);
nodeElement = hasClosestBlock(endElement)
nodeElement = hasClosestBlock(endElement);
if (!nodeElement) {
return;
}

View file

@ -1931,7 +1931,7 @@ export class WYSIWYG {
// 清除选中的子块 https://ld246.com/article/1667826582251
item.querySelectorAll(".protyle-wysiwyg--select").forEach(subItem => {
subItem.classList.remove("protyle-wysiwyg--select");
})
});
});
countBlockWord(ids);
if (toDown) {

View file

@ -381,7 +381,7 @@ export const openHistory = () => {
});
break;
} else if (type === "toggle") {
const iconElement = target.firstElementChild.firstElementChild
const iconElement = target.firstElementChild.firstElementChild;
if (iconElement.classList.contains("b3-list-item__arrow--open")) {
target.nextElementSibling.classList.add("fn__none");
iconElement.classList.remove("b3-list-item__arrow--open");