|
@@ -195,9 +195,9 @@ export const getEditHTML = (options: {
|
|
} else if (colData.type === "date") {
|
|
} else if (colData.type === "date") {
|
|
html += `<button class="b3-menu__separator"></button>
|
|
html += `<button class="b3-menu__separator"></button>
|
|
<label class="b3-menu__item">
|
|
<label class="b3-menu__item">
|
|
- <span class="fn__flex-center">${window.siyuan.languages.backRelation}</span>
|
|
|
|
|
|
+ <span class="fn__flex-center">${window.siyuan.languages.fillCreated}</span>
|
|
<span class="fn__space fn__flex-1"></span>
|
|
<span class="fn__space fn__flex-1"></span>
|
|
- <input data-type="backRelation" type="checkbox" class="b3-switch b3-switch--menu" ${colData.relation?.isTwoWay ? "checked" : ""}>
|
|
|
|
|
|
+ <input data-type="fillCreated" type="checkbox" class="b3-switch b3-switch--menu" ${colData.date?.autoFillNow ? "checked" : ""}>
|
|
</label>`;
|
|
</label>`;
|
|
}
|
|
}
|
|
return `<div class="b3-menu__items">
|
|
return `<div class="b3-menu__items">
|
|
@@ -371,6 +371,22 @@ export const bindEditEvent = (options: {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ const fillCreatedElement = options.menuElement.querySelector('[data-type="fillCreated"]') as HTMLInputElement;
|
|
|
|
+ if (fillCreatedElement) {
|
|
|
|
+ fillCreatedElement.addEventListener("change", () => {
|
|
|
|
+ transaction(options.protyle, [{
|
|
|
|
+ avID,
|
|
|
|
+ action: "setAttrViewColDate",
|
|
|
|
+ id: colId,
|
|
|
|
+ data: fillCreatedElement.checked
|
|
|
|
+ }], [{
|
|
|
|
+ avID,
|
|
|
|
+ action: "setAttrViewColDate",
|
|
|
|
+ id: colId,
|
|
|
|
+ data: !fillCreatedElement.checked
|
|
|
|
+ }]);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
const backRelationElement = options.menuElement.querySelector('[data-type="backRelation"]') as HTMLInputElement;
|
|
const backRelationElement = options.menuElement.querySelector('[data-type="backRelation"]') as HTMLInputElement;
|
|
if (backRelationElement) {
|
|
if (backRelationElement) {
|