mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 06:25:46 +08:00
FEATURE: HOME/END should always take you to the correct spot
This commit is contained in:
parent
8adb08a9ca
commit
759c18d9f5
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user