Compiled
This commit is contained in:
@@ -164,6 +164,16 @@ class PasscodeManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureAutoLock() {
|
configureAutoLock() {
|
||||||
|
PasscodeManager.AutoLockPollFocusInterval = 1 * MillisecondsPerSecond;
|
||||||
|
|
||||||
|
PasscodeManager.AutoLockIntervalNone = 0;
|
||||||
|
PasscodeManager.AutoLockIntervalImmediate = 1;
|
||||||
|
PasscodeManager.AutoLockIntervalOneMinute = 60 * MillisecondsPerSecond;
|
||||||
|
PasscodeManager.AutoLockIntervalFiveMinutes = 300 * MillisecondsPerSecond;
|
||||||
|
PasscodeManager.AutoLockIntervalOneHour = 3600 * MillisecondsPerSecond;
|
||||||
|
|
||||||
|
PasscodeManager.AutoLockIntervalKey = "AutoLockIntervalKey";
|
||||||
|
|
||||||
if(isDesktopApplication()) {
|
if(isDesktopApplication()) {
|
||||||
// desktop only
|
// desktop only
|
||||||
this.$rootScope.$on("window-lost-focus", () => {
|
this.$rootScope.$on("window-lost-focus", () => {
|
||||||
@@ -173,20 +183,27 @@ class PasscodeManager {
|
|||||||
this.documentVisibilityChanged(true);
|
this.documentVisibilityChanged(true);
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// tab visibility listender, web only
|
// tab visibility listener, web only
|
||||||
document.addEventListener('visibilitychange', (e) => {
|
document.addEventListener('visibilitychange', (e) => {
|
||||||
let visible = document.visibilityState == "visible";
|
let visible = document.visibilityState == "visible";
|
||||||
this.documentVisibilityChanged(visible);
|
this.documentVisibilityChanged(visible);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// verify document is in focus every so often as visibilitychange event is not triggered
|
||||||
|
// on a typical window blur event but rather on tab changes
|
||||||
|
this.pollFocusTimeout = setInterval(() => {
|
||||||
|
let hasFocus = document.hasFocus();
|
||||||
|
|
||||||
|
if(hasFocus && this.lastFocusState == "hidden") {
|
||||||
|
this.documentVisibilityChanged(true);
|
||||||
|
} else if(!hasFocus && this.lastFocusState == "visible") {
|
||||||
|
this.documentVisibilityChanged(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// save this to compare against next time around
|
||||||
|
this.lastFocusState = hasFocus ? "visible" : "hidden";
|
||||||
|
}, PasscodeManager.AutoLockPollFocusInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
PasscodeManager.AutoLockIntervalNone = 0;
|
|
||||||
PasscodeManager.AutoLockIntervalImmediate = 1;
|
|
||||||
PasscodeManager.AutoLockIntervalOneMinute = 60 * MillisecondsPerSecond;
|
|
||||||
PasscodeManager.AutoLockIntervalFiveMinutes = 300 * MillisecondsPerSecond;
|
|
||||||
PasscodeManager.AutoLockIntervalOneHour = 3600 * MillisecondsPerSecond;
|
|
||||||
|
|
||||||
PasscodeManager.AutoLockIntervalKey = "AutoLockIntervalKey";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getAutoLockIntervalOptions() {
|
getAutoLockIntervalOptions() {
|
||||||
|
|||||||
33
dist/javascripts/compiled.js
vendored
33
dist/javascripts/compiled.js
vendored
@@ -61071,6 +61071,14 @@ function () {
|
|||||||
value: function configureAutoLock() {
|
value: function configureAutoLock() {
|
||||||
var _this80 = this;
|
var _this80 = this;
|
||||||
|
|
||||||
|
PasscodeManager.AutoLockPollFocusInterval = 1 * MillisecondsPerSecond;
|
||||||
|
PasscodeManager.AutoLockIntervalNone = 0;
|
||||||
|
PasscodeManager.AutoLockIntervalImmediate = 1;
|
||||||
|
PasscodeManager.AutoLockIntervalOneMinute = 60 * MillisecondsPerSecond;
|
||||||
|
PasscodeManager.AutoLockIntervalFiveMinutes = 300 * MillisecondsPerSecond;
|
||||||
|
PasscodeManager.AutoLockIntervalOneHour = 3600 * MillisecondsPerSecond;
|
||||||
|
PasscodeManager.AutoLockIntervalKey = "AutoLockIntervalKey";
|
||||||
|
|
||||||
if (isDesktopApplication()) {
|
if (isDesktopApplication()) {
|
||||||
// desktop only
|
// desktop only
|
||||||
this.$rootScope.$on("window-lost-focus", function () {
|
this.$rootScope.$on("window-lost-focus", function () {
|
||||||
@@ -61080,20 +61088,27 @@ function () {
|
|||||||
_this80.documentVisibilityChanged(true);
|
_this80.documentVisibilityChanged(true);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// tab visibility listender, web only
|
// tab visibility listener, web only
|
||||||
document.addEventListener('visibilitychange', function (e) {
|
document.addEventListener('visibilitychange', function (e) {
|
||||||
var visible = document.visibilityState == "visible";
|
var visible = document.visibilityState == "visible";
|
||||||
|
|
||||||
_this80.documentVisibilityChanged(visible);
|
_this80.documentVisibilityChanged(visible);
|
||||||
});
|
}); // verify document is in focus every so often as visibilitychange event is not triggered
|
||||||
}
|
// on a typical window blur event but rather on tab changes
|
||||||
|
|
||||||
PasscodeManager.AutoLockIntervalNone = 0;
|
this.pollFocusTimeout = setInterval(function () {
|
||||||
PasscodeManager.AutoLockIntervalImmediate = 1;
|
var hasFocus = document.hasFocus();
|
||||||
PasscodeManager.AutoLockIntervalOneMinute = 60 * MillisecondsPerSecond;
|
|
||||||
PasscodeManager.AutoLockIntervalFiveMinutes = 300 * MillisecondsPerSecond;
|
if (hasFocus && _this80.lastFocusState == "hidden") {
|
||||||
PasscodeManager.AutoLockIntervalOneHour = 3600 * MillisecondsPerSecond;
|
_this80.documentVisibilityChanged(true);
|
||||||
PasscodeManager.AutoLockIntervalKey = "AutoLockIntervalKey";
|
} else if (!hasFocus && _this80.lastFocusState == "visible") {
|
||||||
|
_this80.documentVisibilityChanged(false);
|
||||||
|
} // save this to compare against next time around
|
||||||
|
|
||||||
|
|
||||||
|
_this80.lastFocusState = hasFocus ? "visible" : "hidden";
|
||||||
|
}, PasscodeManager.AutoLockPollFocusInterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getAutoLockIntervalOptions",
|
key: "getAutoLockIntervalOptions",
|
||||||
|
|||||||
2
dist/javascripts/compiled.min.js
vendored
2
dist/javascripts/compiled.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user