moved protected note switch to "note actions", added shadow to protected note title

This commit is contained in:
zadam
2020-04-29 00:01:07 +02:00
parent 989a003d2f
commit 4c308ad68f
6 changed files with 89 additions and 47 deletions

View File

@@ -17,6 +17,10 @@ const TPL = `
min-width: 5em;
width: 100%;
}
.note-title-container input.note-title.protected {
text-shadow: 4px 4px 4px var(--muted-text-color);
}
</style>
<input autocomplete="off" value="" class="note-title" tabindex="1">
@@ -52,6 +56,8 @@ export default class NoteTitleWidget extends TabAwareWidget {
this.$noteTitle.val(note.title);
this.$noteTitle.prop("readonly", note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable());
console.trace("Refreshing - isProtected: ", !!note.isProtected);
this.$noteTitle.toggleClass("protected", !!note.isProtected);
}
async beforeNoteSwitchEvent({tabContext}) {
@@ -80,6 +86,12 @@ export default class NoteTitleWidget extends TabAwareWidget {
}
}
entitiesReloadedEvent({loadResults}) {
if (loadResults.isNoteReloaded(this.noteId)) {
this.refresh();
}
}
beforeUnloadEvent() {
this.spacedUpdate.updateNowIfNecessary();
}