desktopManager window blur event
This commit is contained in:
@@ -79,6 +79,10 @@ class DesktopManager {
|
||||
this.searchHandler = handler;
|
||||
}
|
||||
|
||||
desktop_windowLostFocus() {
|
||||
this.$rootScope.$broadcast("window-lost-focus");
|
||||
}
|
||||
|
||||
desktop_onComponentInstallationComplete(componentData, error) {
|
||||
console.log("Web|Component Installation/Update Complete", componentData, error);
|
||||
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
class PasscodeManager {
|
||||
|
||||
constructor(authManager, storageManager) {
|
||||
document.addEventListener('visibilitychange', (e) => {
|
||||
this.documentVisibilityChanged(document.visibilityState);
|
||||
});
|
||||
constructor($rootScope, authManager, storageManager) {
|
||||
if(isDesktopApplication()) {
|
||||
// desktop only
|
||||
$rootScope.$on("window-lost-focus", () => {
|
||||
let visible = false;
|
||||
this.documentVisibilityChanged(visible);
|
||||
})
|
||||
} else {
|
||||
// tab visibility listender, web only
|
||||
document.addEventListener('visibilitychange', (e) => {
|
||||
let visible = document.visibilityState == "visible";
|
||||
this.documentVisibilityChanged(visible);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.authManager = authManager;
|
||||
this.storageManager = storageManager;
|
||||
@@ -13,6 +24,7 @@ class PasscodeManager {
|
||||
|
||||
const MillisecondsPerSecond = 1000;
|
||||
PasscodeManager.AutoLockIntervalNone = 0;
|
||||
PasscodeManager.AutoLockIntervalImmediate = 1;
|
||||
PasscodeManager.AutoLockIntervalOneMinute = 60 * MillisecondsPerSecond;
|
||||
PasscodeManager.AutoLockIntervalFiveMinutes = 300 * MillisecondsPerSecond;
|
||||
PasscodeManager.AutoLockIntervalOneHour = 3600 * MillisecondsPerSecond;
|
||||
@@ -26,6 +38,10 @@ class PasscodeManager {
|
||||
value: PasscodeManager.AutoLockIntervalNone,
|
||||
label: "None"
|
||||
},
|
||||
{
|
||||
value: PasscodeManager.AutoLockIntervalImmediate,
|
||||
label: "Immediately"
|
||||
},
|
||||
{
|
||||
value: PasscodeManager.AutoLockIntervalOneMinute,
|
||||
label: "1 Min"
|
||||
@@ -41,8 +57,7 @@ class PasscodeManager {
|
||||
]
|
||||
}
|
||||
|
||||
documentVisibilityChanged(visbility) {
|
||||
let visible = document.visibilityState == "visible";
|
||||
documentVisibilityChanged(visible) {
|
||||
if(!visible) {
|
||||
this.beginAutoLockTimer();
|
||||
} else {
|
||||
|
||||
@@ -53,3 +53,7 @@
|
||||
opacity: 1.0
|
||||
}
|
||||
}
|
||||
|
||||
button.sk-button {
|
||||
border: none;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
.sk-horizontal-group
|
||||
.sk-h4.sk-bold Autolock
|
||||
%a.sk-a.info{"ng-repeat" => "option in passcodeAutoLockOptions", "ng-click" => "selectAutoLockInterval(option.value)",
|
||||
"ng-class" => "{'info boxed' : option.value == selectedAutoLockInterval}"}
|
||||
"ng-class" => "{'boxed' : option.value == selectedAutoLockInterval}"}
|
||||
{{option.label}}
|
||||
.sk-p The autolock timer begins when the window or tab loses focus.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user