mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 19:52:28 +08:00
feat(time_selector): avoid "template concatenation"
This commit is contained in:
parent
fc8f805b28
commit
d26d668741
@ -9,9 +9,7 @@ const TPL = `
|
|||||||
<h4>${t("attachment_erasure_timeout.attachment_erasure_timeout")}</h4>
|
<h4>${t("attachment_erasure_timeout.attachment_erasure_timeout")}</h4>
|
||||||
|
|
||||||
<p>${t("attachment_erasure_timeout.attachment_auto_deletion_description")}</p>
|
<p>${t("attachment_erasure_timeout.attachment_auto_deletion_description")}</p>
|
||||||
`;
|
<div id="time-selector-placeholder"></div>
|
||||||
|
|
||||||
const TPL2 = `
|
|
||||||
<p>${t("attachment_erasure_timeout.manual_erasing_description")}</p>
|
<p>${t("attachment_erasure_timeout.manual_erasing_description")}</p>
|
||||||
|
|
||||||
<button class="erase-unused-attachments-now-button btn btn-secondary">${t("attachment_erasure_timeout.erase_unused_attachments_now")}</button>
|
<button class="erase-unused-attachments-now-button btn btn-secondary">${t("attachment_erasure_timeout.erase_unused_attachments_now")}</button>
|
||||||
@ -31,7 +29,10 @@ export default class AttachmentErasureTimeoutOptions extends TimeSelector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL).append(this.$widget).append(TPL2);
|
const $timeSelector = this.$widget;
|
||||||
|
this.$widget = $(TPL);
|
||||||
|
// inject TimeSelector widget template
|
||||||
|
this.$widget.find("#time-selector-placeholder").replaceWith($timeSelector);
|
||||||
|
|
||||||
this.$eraseUnusedAttachmentsNowButton = this.$widget.find(".erase-unused-attachments-now-button");
|
this.$eraseUnusedAttachmentsNowButton = this.$widget.find(".erase-unused-attachments-now-button");
|
||||||
this.$eraseUnusedAttachmentsNowButton.on("click", () => {
|
this.$eraseUnusedAttachmentsNowButton.on("click", () => {
|
||||||
|
@ -9,9 +9,7 @@ const TPL = `
|
|||||||
<div class="options-section">
|
<div class="options-section">
|
||||||
<h4>${t("note_erasure_timeout.note_erasure_timeout_title")}</h4>
|
<h4>${t("note_erasure_timeout.note_erasure_timeout_title")}</h4>
|
||||||
<p>${t("note_erasure_timeout.note_erasure_description")}</p>
|
<p>${t("note_erasure_timeout.note_erasure_description")}</p>
|
||||||
`;
|
<div id="time-selector-placeholder"></div>
|
||||||
|
|
||||||
const TPL2 = `
|
|
||||||
<p>${t("note_erasure_timeout.manual_erasing_description")}</p>
|
<p>${t("note_erasure_timeout.manual_erasing_description")}</p>
|
||||||
<button id="erase-deleted-notes-now-button" class="btn btn-secondary">${t("note_erasure_timeout.erase_deleted_notes_now")}</button>
|
<button id="erase-deleted-notes-now-button" class="btn btn-secondary">${t("note_erasure_timeout.erase_deleted_notes_now")}</button>
|
||||||
</div>`;
|
</div>`;
|
||||||
@ -30,7 +28,10 @@ export default class NoteErasureTimeoutOptions extends TimeSelector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL).append(this.$widget).append(TPL2);
|
const $timeSelector = this.$widget;
|
||||||
|
// inject TimeSelector widget template
|
||||||
|
this.$widget = $(TPL);
|
||||||
|
this.$widget.find("#time-selector-placeholder").replaceWith($timeSelector)
|
||||||
|
|
||||||
this.$eraseDeletedNotesButton = this.$widget.find("#erase-deleted-notes-now-button");
|
this.$eraseDeletedNotesButton = this.$widget.find("#erase-deleted-notes-now-button");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user