BUGFIX: pressing '?' will now always open the keyboard shortcut modal
This commit is contained in:
parent
da6af9024d
commit
ec10575a9e
|
@ -13,7 +13,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||||
'g u': '/unread',
|
'g u': '/unread',
|
||||||
'g f': '/favorited',
|
'g f': '/favorited',
|
||||||
'g c': '/categories',
|
'g c': '/categories',
|
||||||
'g t': '/top',
|
'g t': '/top'
|
||||||
},
|
},
|
||||||
|
|
||||||
CLICK_BINDINGS: {
|
CLICK_BINDINGS: {
|
||||||
|
@ -37,8 +37,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||||
's': '#topic-footer-buttons button.share', // share topic
|
's': '#topic-footer-buttons button.share', // share topic
|
||||||
'S': 'article.selected button.share', // share selected post
|
'S': 'article.selected button.share', // share selected post
|
||||||
'/': '#search-button', // focus search
|
'/': '#search-button', // focus search
|
||||||
'!': 'article.selected button.flag', // flag selected post
|
'!': 'article.selected button.flag' // flag selected post
|
||||||
'?': '#keyboard-help' // open keyboard shortcut help
|
|
||||||
},
|
},
|
||||||
|
|
||||||
FUNCTION_BINDINGS: {
|
FUNCTION_BINDINGS: {
|
||||||
|
@ -46,7 +45,8 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||||
'k': 'selectUp',
|
'k': 'selectUp',
|
||||||
'u': 'goBack',
|
'u': 'goBack',
|
||||||
'`': 'nextSection',
|
'`': 'nextSection',
|
||||||
'~': 'prevSection'
|
'~': 'prevSection',
|
||||||
|
'?': 'showHelpModal' // open keyboard shortcut help
|
||||||
},
|
},
|
||||||
|
|
||||||
bindEvents: function(keyTrapper) {
|
bindEvents: function(keyTrapper) {
|
||||||
|
@ -76,6 +76,10 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
||||||
this._changeSection(-1);
|
this._changeSection(-1);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showHelpModal: function() {
|
||||||
|
Discourse.__container__.lookup('controller:application').send("showKeyboardShortcutsHelp");
|
||||||
|
},
|
||||||
|
|
||||||
_bindToPath: function(path, binding) {
|
_bindToPath: function(path, binding) {
|
||||||
this.keyTrapper.bind(binding, function() {
|
this.keyTrapper.bind(binding, function() {
|
||||||
Discourse.URL.routeTo(path);
|
Discourse.URL.routeTo(path);
|
||||||
|
|
Loading…
Reference in New Issue