Skip to content

Build your personal knowledge base with Trilium Notes

mini refactoring

azivnerd31a13644279
diff --git a/src/public/javascripts/dialogs/event_log.js b/src/public/javascripts/dialogs/event_log.js
index 9130bae3fa..61135bae3b 100644
--- a/src/public/javascripts/dialogs/event_log.js
+++ b/src/public/javascripts/dialogs/event_log.js
@@ -16,7 +16,7 @@ async function showDialog() {
const result = await server.get('event-log');
- $list.html('');
+ $list.empty();
for (const event of result) {
const dateTime = utils.formatDateTime(utils.parseDate(event.dateCreated));
diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js
index 4737b56a72..6a6839615c 100644
--- a/src/public/javascripts/services/note_detail.js
+++ b/src/public/javascripts/services/note_detail.js
@@ -119,11 +119,9 @@ async function saveNoteIfChanged() {
}
function setNoteBackgroundIfProtected(note) {
- const isProtected = note.isProtected;
-
- $noteDetailWrapper.toggleClass("protected", isProtected);
- $protectButton.toggleClass("active", isProtected);
- $unprotectButton.toggleClass("active", !isProtected);
+ $noteDetailWrapper.toggleClass("protected", note.isProtected);
+ $protectButton.toggleClass("active", note.isProtected);
+ $unprotectButton.toggleClass("active", !note.isProtected);
$unprotectButton.prop("disabled", !protectedSessionHolder.isProtectedSessionAvailable());
}
@@ -183,7 +181,7 @@ async function loadNoteDetail(noteId) {
// after loading new note make sure editor is scrolled to the top
$noteDetailWrapper.scrollTop(0);
- $scriptArea.html('');
+ $scriptArea.empty();
await bundleService.executeRelationBundles(getCurrentNote(), 'runOnNoteView');
@@ -417,7 +415,7 @@ async function loadAttributes() {
$promotedAttributesContainer.empty().append($tbody);
}
else {
- $attributeListInner.html('');
+ $attributeListInner.empty();
if (attributes.length > 0) {
for (const attribute of attributes) {