mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-13 02:34:20 +01:00
This commit is contained in:
parent
ec4da7cde7
commit
c8ea33c5ce
13 changed files with 372 additions and 245 deletions
|
|
@ -353,6 +353,8 @@ export const getColIconByType = (type: TAVCol) => {
|
|||
return "iconPhone";
|
||||
case "template":
|
||||
return "iconMath";
|
||||
case "checkbox":
|
||||
return "iconCheck";
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -379,7 +381,7 @@ export const addAttrViewColAnimation = (options: {
|
|||
if (index === 0) {
|
||||
html = `<div class="av__cell" data-icon="${options.icon || ""}" data-col-id="${options.id}" data-dtype="${options.type}" style="width: 200px;white-space: nowrap;">
|
||||
<div draggable="true" class="av__cellheader">
|
||||
${options.icon ? unicode2Emoji(options.icon, "av__cellicon", true) : `<svg class="av__cellicon"><use xlink:href="#${getColIconByType(options.type)}"></use></svg>`}
|
||||
${options.icon ? unicode2Emoji(options.icon, "av__cellheadericon", true) : `<svg class="av__cellheadericon"><use xlink:href="#${getColIconByType(options.type)}"></use></svg>`}
|
||||
<span class="av__celltext">${options.name}</span>
|
||||
</div>
|
||||
<div class="av__widthdrag"></div>
|
||||
|
|
@ -825,6 +827,31 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
|
|||
});
|
||||
}
|
||||
});
|
||||
menu.addItem({
|
||||
icon: "iconCheck",
|
||||
label: window.siyuan.languages.checkbox,
|
||||
click() {
|
||||
const id = Lute.NewNodeID();
|
||||
transaction(protyle, [{
|
||||
action: "addAttrViewCol",
|
||||
name: window.siyuan.languages.checkbox,
|
||||
avID,
|
||||
type: "checkbox",
|
||||
id
|
||||
}], [{
|
||||
action: "removeAttrViewCol",
|
||||
id,
|
||||
avID,
|
||||
}]);
|
||||
addAttrViewColAnimation({
|
||||
blockElement: blockElement,
|
||||
protyle: protyle,
|
||||
type: "checkbox",
|
||||
name: window.siyuan.languages.checkbox,
|
||||
id
|
||||
});
|
||||
}
|
||||
});
|
||||
menu.addItem({
|
||||
icon: "iconLink",
|
||||
label: window.siyuan.languages.link,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue