mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
808abac04a
commit
25169ce636
1 changed files with 25 additions and 0 deletions
|
|
@ -187,6 +187,13 @@ export const getEditHTML = (options: {
|
|||
<span class="fn__flex-center">${window.siyuan.languages.fillSpecificTime}</span>
|
||||
<span class="fn__space fn__flex-1"></span>
|
||||
<input data-type="fillSpecificTime" type="checkbox" class="b3-switch b3-switch--menu" ${colData.date?.fillSpecificTime ? "checked" : ""}>
|
||||
</label>`;
|
||||
} else if (["updated", "created"].includes(colData.type)) {
|
||||
html += `<button class="b3-menu__separator" data-id="separator_2"></button>
|
||||
<label class="b3-menu__item">
|
||||
<span class="fn__flex-center">${window.siyuan.languages.includeTime}</span>
|
||||
<span class="fn__space fn__flex-1"></span>
|
||||
<input data-type="includeTime" type="checkbox" class="b3-switch b3-switch--menu" ${colData.date?.includeTime ? "checked" : ""}>
|
||||
</label>`;
|
||||
}
|
||||
html += `<button class="b3-menu__separator" data-id="separator_3"></button>
|
||||
|
|
@ -365,6 +372,24 @@ export const bindEditEvent = (options: {
|
|||
});
|
||||
}
|
||||
|
||||
const includeTimeElement = options.menuElement.querySelector('.b3-switch[data-type="includeTime"]') as HTMLInputElement;
|
||||
if (includeTimeElement) {
|
||||
includeTimeElement.addEventListener("change", () => {
|
||||
transaction(options.protyle, [{
|
||||
action: "setAttrViewUpdatedIncludeTime",
|
||||
id: colId,
|
||||
avID,
|
||||
data: includeTimeElement.checked,
|
||||
}], [{
|
||||
action: "setAttrViewUpdatedIncludeTime",
|
||||
id: colId,
|
||||
avID,
|
||||
data: !includeTimeElement.checked,
|
||||
}]);
|
||||
colData.includeTime = includeTimeElement.checked;
|
||||
});
|
||||
}
|
||||
|
||||
const wrapElement = options.menuElement.querySelector('.b3-switch[data-type="wrap"]') as HTMLInputElement;
|
||||
if (wrapElement) {
|
||||
wrapElement.addEventListener("change", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue