feat: Add "a" keyboard shortcut to bookmark a toot. (#2268)
Fixes #2237. Co-authored-by: Nolan Lawson <nolan@nolanlawson.com>
This commit is contained in:
parent
da28e98cfb
commit
30b00667f2
|
@ -154,6 +154,7 @@ export default {
|
|||
<li><kbd>b</kbd> to boost</li>
|
||||
<li><kbd>r</kbd> to reply</li>
|
||||
<li><kbd>Escape</kbd> to close reply</li>
|
||||
<li><kbd>a</kbd> to bookmark</li>
|
||||
<li><kbd>i</kbd> to open images, video, or audio</li>
|
||||
<li><kbd>y</kbd> to show or hide sensitive media</li>
|
||||
<li><kbd>m</kbd> to mention the author</li>
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
<Shortcut scope={shortcutScope} key="r" on:pressed="reply()"/>
|
||||
<Shortcut scope={shortcutScope} key="escape" on:pressed="dismiss()"/>
|
||||
<Shortcut scope={shortcutScope} key="b" on:pressed="reblog(true)"/>
|
||||
<Shortcut scope={shortcutScope} key="a" on:pressed="bookmark()"/>
|
||||
{/if}
|
||||
<style>
|
||||
.status-toolbar {
|
||||
|
@ -81,6 +82,7 @@
|
|||
import { CHECKMARK_ANIMATION, FAVORITE_ANIMATION, REBLOG_ANIMATION } from '../../_static/animations.js'
|
||||
import { on } from '../../_utils/eventBus.js'
|
||||
import { announceAriaLivePolite } from '../../_utils/announceAriaLivePolite.js'
|
||||
import { setStatusBookmarkedOrUnbookmarked } from '../../_actions/bookmark.js'
|
||||
|
||||
export default {
|
||||
oncreate () {
|
||||
|
@ -174,6 +176,10 @@
|
|||
// return status to the reply button after posting a reply
|
||||
this.refs.node.querySelector('.status-toolbar-reply-button').focus({ preventScroll: true })
|
||||
} catch (e) { /* ignore */ }
|
||||
},
|
||||
bookmark () {
|
||||
const { originalStatus, originalStatusId } = this.get()
|
||||
/* no await */ setStatusBookmarkedOrUnbookmarked(originalStatusId, !originalStatus.bookmarked)
|
||||
}
|
||||
},
|
||||
data: () => ({
|
||||
|
|
Loading…
Reference in New Issue