mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
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
1 changed files with 5 additions and 2 deletions
|
@ -27,8 +27,6 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||||
},
|
},
|
||||||
|
|
||||||
CLICK_BINDINGS: {
|
CLICK_BINDINGS: {
|
||||||
'c': '#create-topic', // create new topic
|
|
||||||
|
|
||||||
// star topic
|
// star topic
|
||||||
'f': '#topic-footer-buttons button.star, .topic-list tr.topic-list-item.selected a.star',
|
'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: {
|
FUNCTION_BINDINGS: {
|
||||||
|
'c': 'createTopic', // create new topic
|
||||||
'home': 'goToFirstPost',
|
'home': 'goToFirstPost',
|
||||||
'#': 'toggleProgress',
|
'#': 'toggleProgress',
|
||||||
'end': 'goToLastPost',
|
'end': 'goToLastPost',
|
||||||
|
@ -131,6 +130,10 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||||
return showSearch ? this.showSearch(true) : true;
|
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() {
|
toggleProgress: function() {
|
||||||
Discourse.__container__.lookup('controller:topic-progress').send('toggleExpansion', {highlight: true});
|
Discourse.__container__.lookup('controller:topic-progress').send('toggleExpansion', {highlight: true});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue