Merge pull request #4258 from bl1nk/recent-mentions-keybind

Toggle recent mentions popup with alt+m
This commit is contained in:
Max Leiter 2021-06-28 21:54:46 -07:00 committed by GitHub
commit 5a7781eabc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

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

View File

@ -189,6 +189,16 @@
</div> </div>
</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="help-item">
<div class="subject"> <div class="subject">
<span><kbd>Esc</kbd></span> <span><kbd>Esc</kbd></span>