mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-06 23:51:48 +01:00
This commit is contained in:
parent
1ab9b5c518
commit
19bbd04bd8
3 changed files with 24 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ ${cell.valueType === "block" ? 'data-block-id="' + (cell.value.block.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, view.showIcon, "gallery")}<div class="av__gallery-tip">${view.fields[fieldsIndex].icon ? unicode2Emoji(view.fields[fieldsIndex].icon, undefined, true) : `<svg><use xlink:href="#${getColIconByType(view.fields[fieldsIndex].type)}"></use></svg>`}${window.siyuan.languages.edit} ${ Lute.EscapeHTMLStr(view.fields[fieldsIndex].name)}</div></div>`;
|
||||
${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex, view.showIcon, "gallery")}<div class="av__gallery-tip">${view.fields[fieldsIndex].icon ? unicode2Emoji(view.fields[fieldsIndex].icon, undefined, true) : `<svg><use xlink:href="#${getColIconByType(view.fields[fieldsIndex].type)}"></use></svg>`}${window.siyuan.languages.edit} ${Lute.EscapeHTMLStr(view.fields[fieldsIndex].name)}</div></div>`;
|
||||
});
|
||||
galleryHTML += `</div>
|
||||
<div class="av__gallery-actions">
|
||||
|
|
@ -197,7 +197,7 @@ ${view.hideAttrViewName ? " av__gallery--top" : ""}">
|
|||
galleryElement.classList.remove("av__gallery--top");
|
||||
}
|
||||
}
|
||||
if (view.coverFrom === 1) {
|
||||
if (view.coverFrom === 1 || view.coverFrom === 3) {
|
||||
processRender(options.blockElement);
|
||||
}
|
||||
if (typeof oldOffset === "number") {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,26 @@ export const setGalleryCover = (options: {
|
|||
targetNameElement.textContent = window.siyuan.languages.calcOperatorNone;
|
||||
}
|
||||
});
|
||||
menu.addItem({
|
||||
iconHTML: "",
|
||||
checked: options.view.coverFrom === 3,
|
||||
label: window.siyuan.languages.contentBlock,
|
||||
click() {
|
||||
transaction(options.protyle, [{
|
||||
action: "setAttrViewCoverFrom",
|
||||
avID,
|
||||
blockID,
|
||||
data: 3
|
||||
}], [{
|
||||
action: "setAttrViewCoverFrom",
|
||||
avID,
|
||||
blockID,
|
||||
data: options.view.coverFrom
|
||||
}]);
|
||||
options.view.coverFrom = 3;
|
||||
targetNameElement.textContent = window.siyuan.languages.contentBlock;
|
||||
}
|
||||
});
|
||||
menu.addItem({
|
||||
iconHTML: "",
|
||||
checked: options.view.coverFrom === 1,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ export const getLayoutHTML = (data: IAV) => {
|
|||
coverFromTitle = window.siyuan.languages.calcOperatorNone;
|
||||
} else if (view.coverFrom === 1) {
|
||||
coverFromTitle = window.siyuan.languages.contentImage;
|
||||
} else if (view.coverFrom === 3) {
|
||||
coverFromTitle = window.siyuan.languages.contentBlock;
|
||||
} else {
|
||||
view.fields.find(item => {
|
||||
if (item.type === "mAsset" && item.id === view.coverFromAssetKeyID) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue