mini refactoring

This commit is contained in:
azivner 2018-08-28 14:26:11 +02:00
parent 21a96d2776
commit d31a136442
2 changed files with 6 additions and 8 deletions

View file

@ -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));

View file

@ -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) {