mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
5c57054eba
commit
978d0151f5
5 changed files with 7 additions and 6 deletions
|
|
@ -11,6 +11,7 @@ export const insertGalleryItemAnimation = (options: {
|
|||
previousId: string;
|
||||
groupID?: string
|
||||
}) => {
|
||||
const type = options.blockElement.getAttribute("data-av-type") as TAVView;
|
||||
(options.blockElement.querySelector('[data-type="av-search"]') as HTMLInputElement).value = "";
|
||||
const groupQuery = options.groupID ? `.av__body[data-group-id="${options.groupID}"] ` : "";
|
||||
let sideItemElement = options.previousId ? options.blockElement.querySelector(groupQuery + `.av__gallery-item[data-id="${options.previousId}"]`) : options.blockElement.querySelector(groupQuery + ".av__gallery-item");
|
||||
|
|
@ -41,7 +42,7 @@ export const insertGalleryItemAnimation = (options: {
|
|||
data-field-id="${item.dataset.fieldId}"
|
||||
data-wrap="${item.dataset.wrap}"
|
||||
data-dtype="${item.dataset.dtype}"
|
||||
${fieldType === "block" ? ' data-detached="true"' : ""}>${renderCell(genCellValue(fieldType, null), lineNumber, false, "gallery")}</div>`;
|
||||
${fieldType === "block" ? ' data-detached="true"' : ""}>${renderCell(genCellValue(fieldType, null), lineNumber, false, type)}</div>`;
|
||||
if (item.previousElementSibling.classList.contains("av__gallery-name")) {
|
||||
cellsHTML += `<div class="av__gallery-field av__gallery-field--name" data-empty="${item.parentElement.dataset.empty}">
|
||||
${item.previousElementSibling.outerHTML}
|
||||
|
|
@ -87,7 +88,7 @@ ${fieldType === "block" ? ' data-detached="true"' : ""}>${renderCell(genCellValu
|
|||
if (cellValue.type === "checkbox" && cellItem.parentElement.querySelector(".av__gallery-tip")) {
|
||||
cellValue.checkbox.content = cellItem.getAttribute("aria-label").split('<div class="ft__on-surface">')[0];
|
||||
}
|
||||
cellItem.innerHTML = renderCell(cellValue, undefined, false, "gallery");
|
||||
cellItem.innerHTML = renderCell(cellValue, undefined, false, type);
|
||||
renderCellAttr(cellItem, cellValue);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ data-field-id="${data.fields[fieldsIndex].id}"
|
|||
data-dtype="${cell.valueType}"
|
||||
${cell.value?.isDetached ? ' data-detached="true"' : ""}
|
||||
style="${cell.bgColor ? `background-color:${cell.bgColor};` : ""}
|
||||
${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex, data.showIcon, "gallery")}</div>`;
|
||||
${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex, data.showIcon, "kanban")}</div>`;
|
||||
if (data.displayFieldName) {
|
||||
galleryHTML += `<div class="av__gallery-field av__gallery-field--name" data-empty="${isEmpty}">
|
||||
<div class="av__gallery-name">
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {getFieldsByData} from "./view";
|
|||
export const getLayoutHTML = (data: IAV) => {
|
||||
let html = "";
|
||||
const view = data.view as IAVKanban;
|
||||
if (data.viewType === "gallery" || data.viewType === "kanban") {
|
||||
if (["gallery", "kanban"].includes(data.viewType)) {
|
||||
let coverFromTitle = "";
|
||||
if (view.coverFrom === 0) {
|
||||
coverFromTitle = window.siyuan.languages.calcOperatorNone;
|
||||
|
|
|
|||
|
|
@ -815,7 +815,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
|||
showMessage(operation.context.message);
|
||||
} else {
|
||||
const groupQuery = operation.groupID ? `[data-group-id="${operation.groupID}"]` : "";
|
||||
if (item.getAttribute("data-av-type") === "gallery") {
|
||||
if (["gallery", "kanban"].includes(item.getAttribute("data-av-type"))) {
|
||||
operation.srcs.forEach(srcItem => {
|
||||
const filesElement = item.querySelector(`.av__body${groupQuery} .av__gallery-item[data-id="${srcItem.itemID}"]`)?.querySelector(".av__gallery-fields");
|
||||
if (filesElement && filesElement.querySelector('[data-dtype="block"]')?.parentElement.getAttribute("data-empty") === "true") {
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ export const insertRows = (options: {
|
|||
id: options.blockElement.dataset.nodeId,
|
||||
data: options.blockElement.getAttribute("updated")
|
||||
}]);
|
||||
if (options.blockElement.getAttribute("data-av-type") === "gallery") {
|
||||
if (["gallery", "kanban"].includes(options.blockElement.getAttribute("data-av-type"))) {
|
||||
insertGalleryItemAnimation({
|
||||
blockElement: options.blockElement,
|
||||
protyle: options.protyle,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue