diff --git a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js index eea7f0cea..4be9ac9a9 100644 --- a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js +++ b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js @@ -41,6 +41,8 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ }, FUNCTION_BINDINGS: { + 'home': 'goToFirstPost', + 'end': 'goToLastPost', 'j': 'selectDown', 'k': 'selectUp', 'u': 'goBack', @@ -56,6 +58,14 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ _.each(this.FUNCTION_BINDINGS, this._bindToFunction, this); }, + goToFirstPost: function() { + Discourse.__container__.lookup('controller:topic').send('jumpTop'); + }, + + goToLastPost: function() { + Discourse.__container__.lookup('controller:topic').send('jumpBottom'); + }, + selectDown: function() { this._moveSelection(1); }, @@ -77,7 +87,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ }, showHelpModal: function() { - Discourse.__container__.lookup('controller:application').send("showKeyboardShortcutsHelp"); + Discourse.__container__.lookup('controller:application').send('showKeyboardShortcutsHelp'); }, _bindToPath: function(path, binding) {