Toggle recent mentions popup with alt-m

This adds a keybind to toggle the recent mentions popup using alt+m (or
opt+m on macOS).

Relates to #4175
This commit is contained in:
Markus Cisler 2021-06-13 01:08:40 +02:00
parent 53a7227e2e
commit a93ccd680f
2 changed files with 15 additions and 0 deletions

View File

@ -51,6 +51,7 @@ export default {
Mousetrap.bind("esc", this.escapeKey);
Mousetrap.bind("alt+u", this.toggleUserList);
Mousetrap.bind("alt+s", this.toggleSidebar);
Mousetrap.bind("alt+m", this.toggleMentions);
// Make a single throttled resize listener available to all components
this.debouncedResize = throttle(() => {
@ -72,6 +73,7 @@ export default {
Mousetrap.unbind("esc", this.escapeKey);
Mousetrap.unbind("alt+u", this.toggleUserList);
Mousetrap.unbind("alt+s", this.toggleSidebar);
Mousetrap.unbind("alt+m", this.toggleMentions);
window.removeEventListener("resize", this.debouncedResize);
clearTimeout(this.dayChangeTimeout);
@ -98,6 +100,9 @@ export default {
return false;
},
toggleMentions() {
eventbus.emit("mentions:toggle");
},
msUntilNextDay() {
// Compute how many milliseconds are remaining until the next day starts
const today = new Date();

View File

@ -189,6 +189,16 @@
</div>
</div>
<div class="help-item">
<div class="subject">
<span v-if="!isApple"><kbd>Alt</kbd> <kbd>M</kbd></span>
<span v-else><kbd></kbd> <kbd>M</kbd></span>
</div>
<div class="description">
<p>Toggle recent mentions popup.</p>
</div>
</div>
<div class="help-item">
<div class="subject">
<span><kbd>Esc</kbd></span>