mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-18 16:32:33 +08:00
chore(client/ts): port switch
This commit is contained in:
parent
f86d9b11b1
commit
6aba099a29
@ -95,6 +95,15 @@ const TPL = `
|
|||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
export default class SwitchWidget extends NoteContextAwareWidget {
|
export default class SwitchWidget extends NoteContextAwareWidget {
|
||||||
|
|
||||||
|
private $switchOn!: JQuery<HTMLElement>;
|
||||||
|
private $switchOnName!: JQuery<HTMLElement>;
|
||||||
|
private $switchOnButton!: JQuery<HTMLElement>;
|
||||||
|
private $switchOff!: JQuery<HTMLElement>;
|
||||||
|
private $switchOffName!: JQuery<HTMLElement>;
|
||||||
|
private $switchOffButton!: JQuery<HTMLElement>;
|
||||||
|
private $helpButton!: JQuery<HTMLElement>;
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
|
|
||||||
@ -113,7 +122,7 @@ export default class SwitchWidget extends NoteContextAwareWidget {
|
|||||||
this.$helpButton = this.$widget.find(".switch-help-button");
|
this.$helpButton = this.$widget.find(".switch-help-button");
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle(state) {
|
toggle(state: boolean) {
|
||||||
if (state) {
|
if (state) {
|
||||||
this.switchOn();
|
this.switchOn();
|
||||||
} else {
|
} else {
|
Loading…
x
Reference in New Issue
Block a user