mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 08:15:52 +01:00
client: switch widget: use a simpler HTML structure and refactor its internals
This commit is contained in:
@@ -6,11 +6,11 @@ export default class ProtectedNoteSwitchWidget extends SwitchWidget {
|
||||
doRender() {
|
||||
super.doRender();
|
||||
|
||||
this.$switchOnName.text(t("protect_note.toggle-on"));
|
||||
this.$switchOnButton.attr("title", t("protect_note.toggle-on-hint"));
|
||||
this.switchOnName = t("protect_note.toggle-on");
|
||||
this.switchOnTooltip = t("protect_note.toggle-on-hint");
|
||||
|
||||
this.$switchOffName.text(t("protect_note.toggle-off"));
|
||||
this.$switchOffButton.attr("title", t("protect_note.toggle-off-hint"));
|
||||
this.switchOffName = t("protect_note.toggle-off");
|
||||
this.switchOffTooltip = t("protect_note.toggle-off-hint");
|
||||
}
|
||||
|
||||
switchOn() {
|
||||
@@ -22,8 +22,7 @@ export default class ProtectedNoteSwitchWidget extends SwitchWidget {
|
||||
}
|
||||
|
||||
async refreshWithNote(note) {
|
||||
this.$switchOn.toggle(!note.isProtected);
|
||||
this.$switchOff.toggle(!!note.isProtected);
|
||||
this.isToggled = note.isProtected;
|
||||
}
|
||||
|
||||
entitiesReloadedEvent({ loadResults }) {
|
||||
|
||||
Reference in New Issue
Block a user