BUGFIX: HOME/END keyboard shortcuts on non-topic pages

This make sure both HOME/END keyboard shortcuts are only applied when viewing a topic
This commit is contained in:
Régis Hanol 2014-03-05 16:08:45 +01:00
parent bce4130d39
commit 2a99f1b15e
1 changed files with 8 additions and 2 deletions

View File

@ -59,11 +59,17 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
},
goToFirstPost: function() {
Discourse.__container__.lookup('controller:topic').send('jumpTop');
this._jumpTo('jumpTop');
},
goToLastPost: function() {
Discourse.__container__.lookup('controller:topic').send('jumpBottom');
this._jumpTo('jumpBottom');
},
_jumpTo: function(direction) {
if ($('#topic-title').length) {
Discourse.__container__.lookup('controller:topic').send(direction);
}
},
selectDown: function() {