Versie 0.3.3
This commit is contained in:
1 parent
1cf6eeed29
commit
6e741a51fe
57 files changed
+1362
-2135
No files matched your search
+10
-1
@@ -1,4 +1,4 @@
|
||||
// Generated, do not edit. sha256:3f4bf112e28f009a738272dd18bef14d5e6736a31c2f3e1f6e434733f909d6ea
|
||||
// Generated, do not edit. sha256:93e679e11f5329a380a996f2d99d603c26410a0b331dfefcb1da78dc2058cc17
|
||||
import { appSetting, setAppSetting } from '../app-settings.js';
|
||||
import { t } from '../i18n/index.js';
|
||||
import { EYE, EYE_OFF } from './icons.js';
|
||||
@@ -37,6 +37,14 @@ async function setOn(on) {
|
||||
|
||||
function onActivity() { if (!isOn()) armIdle(); }
|
||||
|
||||
function onSpace(e) {
|
||||
if (e.key !== ' ' || e.repeat || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey) return;
|
||||
if (e.target !== document.body && e.target !== document.documentElement) return;
|
||||
if (document.querySelector('.nav-edit-toggle.is-on')) return;
|
||||
e.preventDefault();
|
||||
setOn(!isOn());
|
||||
}
|
||||
|
||||
export function initPrivacyBlur(hostEl) {
|
||||
btn = document.createElement('button');
|
||||
btn.type = 'button';
|
||||
@@ -52,5 +60,6 @@ export function initPrivacyBlur(hostEl) {
|
||||
for (const ev of ['pointerdown', 'keydown', 'wheel', 'touchstart']) {
|
||||
document.addEventListener(ev, onActivity, { passive: true });
|
||||
}
|
||||
document.addEventListener('keydown', onSpace);
|
||||
document.addEventListener('settings-changed', () => { if (!isOn()) armIdle(); });
|
||||
}
|
||||
Reference in new issue
Block a user