There is no 'return true' for the shortcuts system

This commit is contained in:
djmaze 2021-08-12 20:55:24 +02:00
parent 64a7b82408
commit 2d87b52c07
5 changed files with 6 additions and 31 deletions

View file

@ -269,8 +269,6 @@ export class Selector {
this.actionClick(focused); this.actionClick(focused);
return false; return false;
} }
return true;
}); });
shortcuts.add('arrowup,arrowdown', 'meta', keyScope, () => false); shortcuts.add('arrowup,arrowdown', 'meta', keyScope, () => false);

View file

@ -1085,7 +1085,6 @@ class ComposePopupView extends AbstractViewPopup {
this.identitiesDropdownTrigger(true); this.identitiesDropdownTrigger(true);
return false; return false;
} }
return true;
} }
onBuild(dom) { onBuild(dom) {

View file

@ -109,7 +109,6 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
showScreenPopup(KeyboardShortcutsHelpPopupView); showScreenPopup(KeyboardShortcutsHelpPopupView);
return false; return false;
} }
return true;
}); });
} }
} }

View file

@ -746,8 +746,6 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
dispatchEvent(new CustomEvent('mailbox.message-view.toggle-full-screen')); dispatchEvent(new CustomEvent('mailbox.message-view.toggle-full-screen'));
return false; return false;
} }
return true;
}); });
if (Settings.capa(Capa.MessageListActions)) { if (Settings.capa(Capa.MessageListActions)) {
@ -859,8 +857,6 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
this.cancelThreadUid(); this.cancelThreadUid();
return false; return false;
} }
return true;
}); });
// change focused state // change focused state

View file

@ -307,6 +307,8 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
} }
onBuild(dom) { onBuild(dom) {
this.oMessageScrollerDom = dom.querySelector('.messageItem');
this.fullScreenMode.subscribe(value => this.fullScreenMode.subscribe(value =>
value && MessageUserStore.message() && AppUserStore.focusedState(Scope.MessageView)); value && MessageUserStore.message() && AppUserStore.focusedState(Scope.MessageView));
@ -414,8 +416,6 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
keyScopeReal.subscribe(value => this.messageDomFocused(Scope.MessageView === value && !inFocus())); keyScopeReal.subscribe(value => this.messageDomFocused(Scope.MessageView === value && !inFocus()));
this.oMessageScrollerDom = dom.querySelector('.messageItem');
// initShortcuts // initShortcuts
// exit fullscreen, back // exit fullscreen, back
@ -436,8 +436,6 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
return false; return false;
} }
return true;
}); });
// fullscreen // fullscreen
@ -461,14 +459,12 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
this.replyAllCommand(); this.replyAllCommand();
return false; return false;
} }
return true;
}); });
shortcuts.add('mailreply', 'shift', [Scope.MessageList, Scope.MessageView], () => { shortcuts.add('mailreply', 'shift', [Scope.MessageList, Scope.MessageView], () => {
if (MessageUserStore.message()) { if (MessageUserStore.message()) {
this.replyAllCommand(); this.replyAllCommand();
return false; return false;
} }
return true;
}); });
// forward // forward
@ -477,8 +473,6 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
this.forwardCommand(); this.forwardCommand();
return false; return false;
} }
return true;
}); });
// message information // message information
@ -496,7 +490,6 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
message.body.querySelectorAll('.rlBlockquoteSwitcher').forEach(node => node.click()); message.body.querySelectorAll('.rlBlockquoteSwitcher').forEach(node => node.click());
return false; return false;
} }
return true;
}); });
shortcuts.add('arrowup,arrowleft', 'meta', [Scope.MessageList, Scope.MessageView], () => { shortcuts.add('arrowup,arrowleft', 'meta', [Scope.MessageList, Scope.MessageView], () => {
@ -527,10 +520,8 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
// change focused state // change focused state
shortcuts.add('arrowleft', '', Scope.MessageView, () => { shortcuts.add('arrowleft', '', Scope.MessageView, () => {
if (!this.fullScreenMode() && MessageUserStore.message() && SettingsUserStore.usePreviewPane()) { if (!this.fullScreenMode() && MessageUserStore.message() && SettingsUserStore.usePreviewPane()
if (this.oMessageScrollerDom && 0 < this.oMessageScrollerDom.scrollLeft) { && !this.oMessageScrollerDom.scrollLeft) {
return true;
}
AppUserStore.focusedState(Scope.MessageList); AppUserStore.focusedState(Scope.MessageList);
return false; return false;
} }
@ -603,19 +594,11 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
} }
scrollMessageToTop() { scrollMessageToTop() {
if (this.oMessageScrollerDom) { this.oMessageScrollerDom.scrollTop = (50 < this.oMessageScrollerDom.scrollTop) ? 50 : 0;
if (50 < this.oMessageScrollerDom.scrollTop) {
this.oMessageScrollerDom.scrollTop = 50;
} else {
this.oMessageScrollerDom.scrollTop = 0;
}
}
} }
scrollMessageToLeft() { scrollMessageToLeft() {
if (this.oMessageScrollerDom) { this.oMessageScrollerDom.scrollLeft = 0;
this.oMessageScrollerDom.scrollLeft = 0;
}
} }
downloadAsZip() { downloadAsZip() {