mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Adds a keyboard shortcut (shift+u) for jumping back to the last read post
This commit is contained in:
parent
60975fcc18
commit
243b5756ee
@ -474,6 +474,10 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
||||
DiscourseURL.routeTo(this.get('model.lastPostUrl'), { skipIfOnScreen: false });
|
||||
},
|
||||
|
||||
jumpUnread() {
|
||||
this._jumpToPostId(this.get('model.last_read_post_id'));
|
||||
},
|
||||
|
||||
selectAll() {
|
||||
const posts = this.get('model.postStream.posts');
|
||||
const selectedPosts = this.get('selectedPosts');
|
||||
|
@ -48,6 +48,7 @@ const bindings = {
|
||||
'shift+p': {handler: 'pinUnpinTopic'},
|
||||
'shift+r': {handler: 'replyToTopic'},
|
||||
'shift+s': {click: '#topic-footer-buttons button.share', anonymous: true}, // share topic
|
||||
'shift+u': {handler: 'goToUnreadPost'},
|
||||
'shift+z shift+z': {handler: 'logout'},
|
||||
't': {postAction: 'replyAsNewTopic'},
|
||||
'u': {handler: 'goBack', anonymous: true},
|
||||
@ -117,6 +118,10 @@ export default {
|
||||
this._jumpTo('jumpBottom');
|
||||
},
|
||||
|
||||
goToUnreadPost() {
|
||||
this._jumpTo('jumpUnread');
|
||||
},
|
||||
|
||||
_jumpTo(direction) {
|
||||
if ($('.container.posts').length) {
|
||||
this.container.lookup('controller:topic').send(direction);
|
||||
|
Loading…
Reference in New Issue
Block a user