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