mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
parent
5e7f531c7f
commit
3a48cc8b7f
3 changed files with 60 additions and 58 deletions
|
|
@ -9,11 +9,6 @@ export const $htmlCL = $html.classList;
|
|||
*/
|
||||
export const dropdownVisibility = ko.observable(false).extend({ rateLimit: 0 });
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
export const useKeyboardShortcuts = ko.observable(true);
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
|
|
@ -50,18 +45,8 @@ export const keyScopeFake = ko.observable(KeyState.All);
|
|||
|
||||
export const keyScope = ko.computed({
|
||||
read: () => keyScopeFake(),
|
||||
write: (value) => {
|
||||
write: value => {
|
||||
if (KeyState.Menu !== value) {
|
||||
if (KeyState.Compose === value) {
|
||||
// disableKeyFilter
|
||||
shortcuts.filter = () => useKeyboardShortcuts();
|
||||
} else {
|
||||
// restoreKeyFilter
|
||||
shortcuts.filter = event => !(event.target.matches
|
||||
&& (event.target.matches('input,select,textarea')
|
||||
|| event.target.closest('[contenteditable]')));
|
||||
}
|
||||
|
||||
keyScopeFake(value);
|
||||
if (dropdownVisibility()) {
|
||||
value = KeyState.Menu;
|
||||
|
|
@ -72,12 +57,9 @@ export const keyScope = ko.computed({
|
|||
}
|
||||
});
|
||||
|
||||
keyScopeReal.subscribe((value) => {
|
||||
// console.log('keyScope=' + sValue); // DEBUG
|
||||
shortcuts.setScope(value);
|
||||
});
|
||||
keyScopeReal.subscribe(value => shortcuts.setScope(value));
|
||||
|
||||
dropdownVisibility.subscribe((value) => {
|
||||
dropdownVisibility.subscribe(value => {
|
||||
if (value) {
|
||||
keyScope(KeyState.Menu);
|
||||
} else if (KeyState.Menu === shortcuts.getScope()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue