Compare commits

...

4 commits

3 changed files with 15 additions and 3 deletions

View file

@ -83,6 +83,7 @@ export const setFilter = async (options: {
rectTarget = options.protyle.wysiwyg.element.querySelector(`[data-col-id="${options.target.dataset.colId}"]`).getBoundingClientRect(); rectTarget = options.protyle.wysiwyg.element.querySelector(`[data-col-id="${options.target.dataset.colId}"]`).getBoundingClientRect();
} }
const blockID = options.blockElement.getAttribute("data-node-id"); const blockID = options.blockElement.getAttribute("data-node-id");
let operationElement: HTMLSelectElement = undefined;
const menu = new Menu("set-filter-" + options.filter.column, () => { const menu = new Menu("set-filter-" + options.filter.column, () => {
const oldFilters = JSON.parse(JSON.stringify(options.data.view.filters)); const oldFilters = JSON.parse(JSON.stringify(options.data.view.filters));
if (!operationElement || !operationElement.value) { if (!operationElement || !operationElement.value) {
@ -211,6 +212,7 @@ export const setFilter = async (options: {
if (colData.type === "rollup") { if (colData.type === "rollup") {
if (!colData.rollup || !colData.rollup.relationKeyID || !colData.rollup.keyID) { if (!colData.rollup || !colData.rollup.relationKeyID || !colData.rollup.keyID) {
showMessage(window.siyuan.languages.plsChoose); showMessage(window.siyuan.languages.plsChoose);
document.querySelector(".av__panel")?.remove();
openMenuPanel({ openMenuPanel({
protyle: options.protyle, protyle: options.protyle,
blockElement: options.blockElement, blockElement: options.blockElement,
@ -530,8 +532,8 @@ export const setFilter = async (options: {
} }
} }
}); });
const operationElement = (menu.element.querySelector('.b3-select[data-type="operation"]') as HTMLSelectElement); operationElement = (menu.element.querySelector('.b3-select[data-type="operation"]') as HTMLSelectElement);
operationElement.addEventListener("change", () => { operationElement?.addEventListener("change", () => {
toggleEmpty(operationElement, operationElement.value, filterValue.type); toggleEmpty(operationElement, operationElement.value, filterValue.type);
}); });
const dateTypeElement = menu.element.querySelector('.b3-select[data-type="dateType"]') as HTMLSelectElement; const dateTypeElement = menu.element.querySelector('.b3-select[data-type="dateType"]') as HTMLSelectElement;

View file

@ -1796,7 +1796,10 @@ export class WYSIWYG {
const topElement = getTopAloneElement(item); const topElement = getTopAloneElement(item);
if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") { if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") {
needClipboardWrite = true; needClipboardWrite = true;
const response = await fetchSyncPost("/api/block/getHeadingChildrenDOM", {id: item.getAttribute("data-node-id")}); const response = await fetchSyncPost("/api/block/getHeadingChildrenDOM", {
id: item.getAttribute("data-node-id"),
removeFoldAttr: false
});
html += response.data; html += response.data;
} else { } else {
html += removeEmbed(topElement); html += removeEmbed(topElement);

View file

@ -203,6 +203,12 @@ func Mount(boxID string) (alreadyMount bool, err error) {
return return
} }
boxes, _ := ListNotebooks()
var sort int
if len(boxes) > 0 {
sort = boxes[0].Sort - 1
}
p := filepath.Join(util.WorkingDir, "guide", boxID) p := filepath.Join(util.WorkingDir, "guide", boxID)
if err = filelock.Copy(p, localPath); err != nil { if err = filelock.Copy(p, localPath); err != nil {
return return
@ -218,6 +224,7 @@ func Mount(boxID string) (alreadyMount bool, err error) {
if box := Conf.Box(boxID); nil != box { if box := Conf.Box(boxID); nil != box {
boxConf := box.GetConf() boxConf := box.GetConf()
boxConf.Closed = true boxConf.Closed = true
boxConf.Sort = sort
box.SaveConf(boxConf) box.SaveConf(boxConf)
} }