mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 05:52:38 +08:00
FIX: Make shortcut 'c' global for creating a topic
https://meta.discourse.org/t/keyboard-shortcut-c-create-a-new-topic-does-not-work-globally/18975
This commit is contained in:
parent
da3275ec20
commit
e013694734
@ -27,8 +27,6 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||
},
|
||||
|
||||
CLICK_BINDINGS: {
|
||||
'c': '#create-topic', // create new topic
|
||||
|
||||
// star topic
|
||||
'f': '#topic-footer-buttons button.star, .topic-list tr.topic-list-item.selected a.star',
|
||||
|
||||
@ -47,6 +45,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||
},
|
||||
|
||||
FUNCTION_BINDINGS: {
|
||||
'c': 'createTopic', // create new topic
|
||||
'home': 'goToFirstPost',
|
||||
'#': 'toggleProgress',
|
||||
'end': 'goToLastPost',
|
||||
@ -131,6 +130,10 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||
return showSearch ? this.showSearch(true) : true;
|
||||
},
|
||||
|
||||
createTopic: function() {
|
||||
Discourse.__container__.lookup('controller:composer').send('open', {action: Discourse.Composer.CREATE_TOPIC, draftKey: Discourse.Composer.DRAFT});
|
||||
},
|
||||
|
||||
toggleProgress: function() {
|
||||
Discourse.__container__.lookup('controller:topic-progress').send('toggleExpansion', {highlight: true});
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user