This commit is contained in:
Vanessa 2022-06-09 15:56:03 +08:00
parent 5d7294ac5e
commit bdc4428e99
4 changed files with 36 additions and 3 deletions

View file

@ -550,6 +550,10 @@ export class Files extends Model {
if (targetElement) {
targetElement.querySelector(".b3-list-item__arrow").classList.remove("b3-list-item__arrow--open");
targetElement.querySelector(".b3-list-item__toggle").classList.remove("fn__hidden");
const emojiElement = targetElement.querySelector(".b3-list-item__icon");
if (emojiElement.innerHTML === unicode2Emoji(Constants.SIYUAN_IMAGE_FILE)) {
emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER)
}
if (targetElement.nextElementSibling && targetElement.nextElementSibling.tagName === "UL") {
targetElement.nextElementSibling.remove();
}
@ -593,6 +597,10 @@ export class Files extends Model {
const iconElement = parentElement.querySelector("svg");
iconElement.classList.remove("b3-list-item__arrow--open");
iconElement.parentElement.classList.add("fn__hidden");
const emojiElement = iconElement.parentElement.nextElementSibling;
if (emojiElement.innerHTML === unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER)) {
emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FILE);
}
}
targetElement.parentElement.remove();
} else {
@ -667,6 +675,10 @@ export class Files extends Model {
if (sourceElement.parentElement.previousElementSibling) {
sourceElement.parentElement.previousElementSibling.querySelector(".b3-list-item__toggle").classList.add("fn__hidden");
sourceElement.parentElement.previousElementSibling.querySelector(".b3-list-item__arrow").classList.remove("b3-list-item__arrow--open");
const emojiElement = sourceElement.parentElement.previousElementSibling.querySelector(".b3-list-item__icon");
if (emojiElement.innerHTML === unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER)) {
emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FILE);
}
}
sourceElement.parentElement.remove();
} else {
@ -677,6 +689,10 @@ export class Files extends Model {
// 更新移动到的新文件夹
if (newElement) {
newElement.querySelector(".b3-list-item__toggle").classList.remove("fn__hidden");
const emojiElement = newElement.querySelector(".b3-list-item__icon");
if (emojiElement.innerHTML === unicode2Emoji(Constants.SIYUAN_IMAGE_FILE)) {
emojiElement.innerHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FOLDER);
}
const arrowElement = newElement.querySelector(".b3-list-item__arrow");
if (arrowElement.classList.contains("b3-list-item__arrow--open")) {
arrowElement.classList.remove("b3-list-item__arrow--open");
@ -831,7 +847,7 @@ class="b3-list-item b3-list-item--hide-action" data-path="${item.path}">
<span style="padding-left: ${(item.path.split("/").length - 1) * 16}px" class="b3-list-item__toggle b3-list-item__toggle--hl${item.subFileCount === 0 ? " fn__hidden" : ""}">
<svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
</span>
<span class="b3-list-item__icon b3-tooltips b3-tooltips__n" aria-label="${window.siyuan.languages.changeIcon}">${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_FILE)}</span>
<span class="b3-list-item__icon b3-tooltips b3-tooltips__n" aria-label="${window.siyuan.languages.changeIcon}">${unicode2Emoji(item.icon || (item.subFileCount === 0 ? Constants.SIYUAN_IMAGE_FILE : Constants.SIYUAN_IMAGE_FOLDER))}</span>
<span class="b3-list-item__text">${getDisplayName(item.name, true, true)}</span>
<span data-type="more-file" class="b3-list-item__action b3-tooltips b3-tooltips__nw" aria-label="${window.siyuan.languages.more}">
<svg><use xlink:href="#iconMore"></use></svg>