Merge pull request #2912 from cpradio/pr-make-create-topic-global
FIX: Make shortcut 'c' global for creating a topic
This commit is contained in:
commit
75ffb0a425
|
@ -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').open({action: Discourse.Composer.CREATE_TOPIC, draftKey: Discourse.Composer.DRAFT});
|
||||
},
|
||||
|
||||
toggleProgress: function() {
|
||||
Discourse.__container__.lookup('controller:topic-progress').send('toggleExpansion', {highlight: true});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue