This commit is contained in:
Vanessa 2024-03-03 10:23:44 +08:00
parent e226f4fed3
commit 0d9b091a6b
5 changed files with 22 additions and 22 deletions

View file

@ -2,12 +2,12 @@ export const updateCardHV = () => {
/// #if MOBILE
if (window.matchMedia("(orientation:portrait)").matches) {
document.querySelectorAll(".card__action .card__icon").forEach(item => {
item.classList.remove("fn__none")
})
item.classList.remove("fn__none");
});
} else {
document.querySelectorAll(".card__action .card__icon").forEach(item => {
item.classList.add("fn__none")
})
item.classList.add("fn__none");
});
}
/// #endif
}
};

View file

@ -644,7 +644,7 @@ export class Wnd {
private removeOverCounter(isSaveLayout = false) {
let removeId: string;
let openTime: string;
let removeCount = 0
let removeCount = 0;
this.children.forEach((item, index) => {
if (item.headElement.classList.contains("item--pin") || item.headElement.classList.contains("item--focus")) {
return;

View file

@ -528,7 +528,7 @@ const initSearchEvent = (app: App, element: Element, config: ISearchOption) => {
event.preventDefault();
break;
} else if (type === "unRefNext") {
const unRefRageElement = unRefElement.querySelector("#searchUnRefResult").lastElementChild
const unRefRageElement = unRefElement.querySelector("#searchUnRefResult").lastElementChild;
let currentPage = parseInt(unRefRageElement.textContent);
if (currentPage < parseInt(unRefRageElement.textContent.split("/")[1])) {
currentPage++;
@ -779,7 +779,7 @@ export const goUnRef = () => {
return;
}
getUnRefListMobile(unRefElement);
}
};
const getUnRefListMobile = (element: Element, page = 1) => {
const previousElement = element.querySelector('[data-type="unRefPrevious"]');
@ -817,4 +817,4 @@ const getUnRefListMobile = (element: Element, page = 1) => {
${window.siyuan.languages.emptyContent}
</div>`;
});
}
};

View file

@ -28,16 +28,16 @@ const toggleEmpty = (element: HTMLElement, operator: string, type: TAVCol) => {
if (menuElement) {
if (["date", "updated", "created"].includes(type)) {
const filterElement = menuElement.querySelector('.b3-menu__item div[data-type="filter1"]');
const filter2Element = filterElement.nextElementSibling
const filter2Element = filterElement.nextElementSibling;
if (operator === "Is between") {
filter2Element.classList.remove("fn__none")
filterElement.classList.remove("fn__none")
filter2Element.classList.remove("fn__none");
filterElement.classList.remove("fn__none");
} else if (operator === "Is empty" || operator === "Is not empty") {
filter2Element.classList.add("fn__none")
filterElement.classList.add("fn__none")
filter2Element.classList.add("fn__none");
filterElement.classList.add("fn__none");
} else {
filterElement.classList.remove("fn__none")
filter2Element.classList.add("fn__none")
filterElement.classList.remove("fn__none");
filter2Element.classList.add("fn__none");
}
return;
}
@ -86,7 +86,7 @@ export const setFilter = async (options: {
count: parseInt((directElements[0].parentElement.querySelector(".b3-text-field") as HTMLInputElement).value || "1"),
unit: parseInt((directElements[0].parentElement.lastElementChild as HTMLSelectElement).value),
direction: parseInt(directElements[0].value)
}
};
}
if (typeElements[1].value === "custom") {
newFilter.relativeDate2 = {
@ -436,7 +436,7 @@ export const setFilter = async (options: {
const dateTypeElements = menu.element.querySelectorAll('.b3-select[data-type="dateType"]') as NodeListOf<HTMLSelectElement>;
dateTypeElements.forEach((item) => {
item.addEventListener("change", () => {
const directionElements = menu.element.querySelectorAll('[data-type="dataDirection"]')
const directionElements = menu.element.querySelectorAll('[data-type="dataDirection"]');
const customerElement = directionElements[0].parentElement;
const customer2Element = directionElements[1].parentElement;
const timeElement = customerElement.previousElementSibling;
@ -457,7 +457,7 @@ export const setFilter = async (options: {
dateTypeElements[1].value = "time";
}
});
})
});
menu.element.querySelectorAll('.b3-select[data-type="dataDirection"]').forEach((item: HTMLSelectElement) => {
item.addEventListener("change", () => {
const countElement = item.nextElementSibling.nextElementSibling;
@ -469,7 +469,7 @@ export const setFilter = async (options: {
countElement.nextElementSibling.classList.remove("fn__none");
}
});
})
});
const textElements: NodeListOf<HTMLInputElement> = menu.element.querySelectorAll(".b3-text-field");
textElements.forEach(item => {
@ -572,7 +572,7 @@ export const getFiltersHTML = (data: IAVTable) => {
if (filter.relativeDate2) {
dateValue2 = `${window.siyuan.languages[["pastDate", "current", "nextDate"][filter.relativeDate2.direction + 1]]}
${filter.relativeDate2.direction ? filter.relativeDate2.count : ""}
${window.siyuan.languages[["day", "week", "month", "year"][filter.relativeDate2.unit]]}`
${window.siyuan.languages[["day", "week", "month", "year"][filter.relativeDate2.unit]]}`;
} else {
dateValue = dayjs(filter.value.date.content).format("YYYY-MM-DD");
dateValue2 = dayjs(filter.value.date.content2).format("YYYY-MM-DD");

View file

@ -119,7 +119,7 @@ ${getAttr(item)}
${window.siyuan.languages.emptyContent}
</div>`;
});
}
};
export const unRefMoreMenu = (target: Element, element: Element, edit: Protyle) => {
const menu = new Menu("searchUnRefMore");