closing panes

This commit is contained in:
zadam
2021-05-24 22:29:49 +02:00
parent 2f5d3729de
commit 5707b7e29a
14 changed files with 94 additions and 107 deletions

View File

@@ -0,0 +1,29 @@
import ButtonWidget from "./button_widget.js";
import protectedSessionHolder from "../../services/protected_session_holder.js";
export default class ProtectedSessionStatusWidget extends ButtonWidget {
doRender() {
this.updateSettings();
super.doRender();
}
updateSettings() {
this.settings.icon = protectedSessionHolder.isProtectedSessionAvailable()
? "bx-shield-quarter"
: "bx-log-in";
this.settings.title = protectedSessionHolder.isProtectedSessionAvailable()
? "Protected session is active. Click to leave protected session."
: "Click to enter protected session";
this.settings.command = protectedSessionHolder.isProtectedSessionAvailable()
? "leaveProtectedSession"
: "enterProtectedSession";
}
protectedSessionStartedEvent() {
this.updateSettings();
this.refreshIcon();
}
}