mirror of
https://github.com/zadam/trilium.git
synced 2025-02-20 21:13:11 +08:00
mini refactoring
This commit is contained in:
parent
21a96d2776
commit
d31a136442
2 changed files with 6 additions and 8 deletions
|
@ -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));
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue