mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
dc765676aa
commit
adfbe0b452
1 changed files with 19 additions and 18 deletions
|
@ -124,9 +124,6 @@ export const insertAttrViewBlockAnimation = (options: {
|
||||||
(options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement).value = "";
|
(options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement).value = "";
|
||||||
const hasSort = options.blockElement.querySelector('.av__views [data-type="av-sort"]').classList.contains("block__icon--active");
|
const hasSort = options.blockElement.querySelector('.av__views [data-type="av-sort"]').classList.contains("block__icon--active");
|
||||||
const hasMore = !options.blockElement.querySelector('[data-type="av-load-more"]').classList.contains("fn__none");
|
const hasMore = !options.blockElement.querySelector('[data-type="av-load-more"]').classList.contains("fn__none");
|
||||||
if (hasMore && hasSort) {
|
|
||||||
showMessage(window.siyuan.languages.insertRowTip);
|
|
||||||
}
|
|
||||||
const groupQuery = options.groupID ? `.av__body[data-group-id="${options.groupID}"] ` : "";
|
const groupQuery = options.groupID ? `.av__body[data-group-id="${options.groupID}"] ` : "";
|
||||||
let previousElement = options.blockElement.querySelector(`.av__row[data-id="${options.previousId}"]`) || options.blockElement.querySelector(groupQuery + ".av__row--header");
|
let previousElement = options.blockElement.querySelector(`.av__row[data-id="${options.previousId}"]`) || options.blockElement.querySelector(groupQuery + ".av__row--header");
|
||||||
// 有排序需要加入最后一行
|
// 有排序需要加入最后一行
|
||||||
|
@ -178,22 +175,26 @@ ${colType === "block" ? ' data-detached="true"' : ""}>${renderCell(genCellValue(
|
||||||
groupID: options.groupID,
|
groupID: options.groupID,
|
||||||
previousID: options.previousId,
|
previousID: options.previousId,
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
let popCellElement: HTMLElement;
|
if (!response.data.values) {
|
||||||
options.blockElement.querySelectorAll('[data-type="ghost"]').forEach(rowItem => {
|
showMessage(window.siyuan.languages.insertRowTip);
|
||||||
const updateIds = Object.keys(response.data.values);
|
} else {
|
||||||
rowItem.querySelectorAll(".av__cell").forEach((cellItem: HTMLElement) => {
|
let popCellElement: HTMLElement;
|
||||||
if (!popCellElement && cellItem.getAttribute("data-detached") === "true") {
|
options.blockElement.querySelectorAll('[data-type="ghost"]').forEach(rowItem => {
|
||||||
popCellElement = cellItem;
|
const updateIds = Object.keys(response.data.values);
|
||||||
}
|
rowItem.querySelectorAll(".av__cell").forEach((cellItem: HTMLElement) => {
|
||||||
if (updateIds.includes(cellItem.dataset.colId)) {
|
if (!popCellElement && cellItem.getAttribute("data-detached") === "true") {
|
||||||
const cellValue = response.data.values[cellItem.dataset.colId];
|
popCellElement = cellItem;
|
||||||
cellItem.innerHTML = renderCell(cellValue);
|
}
|
||||||
renderCellAttr(cellItem, cellValue);
|
if (updateIds.includes(cellItem.dataset.colId)) {
|
||||||
}
|
const cellValue = response.data.values[cellItem.dataset.colId];
|
||||||
|
cellItem.innerHTML = renderCell(cellValue);
|
||||||
|
renderCellAttr(cellItem, cellValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
if (options.srcIDs.length === 1 && !(hasMore && hasSort)) {
|
||||||
if (options.srcIDs.length === 1 && !(hasMore && hasSort)) {
|
popTextCell(options.protyle, [popCellElement], "block");
|
||||||
popTextCell(options.protyle, [popCellElement], "block");
|
}
|
||||||
}
|
}
|
||||||
setPage(options.blockElement);
|
setPage(options.blockElement);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue