diff --git a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js index 6db20f7e6c8..21fe55c0ff2 100644 --- a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js +++ b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js @@ -36,7 +36,6 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ 'R': 'article.selected button.create', // reply to selected post 's': '#topic-footer-buttons button.share', // share topic 'S': 'article.selected button.share', // share selected post - '/': '#search-button', // focus search '!': 'article.selected button.flag' // flag selected post }, @@ -48,6 +47,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ 'u': 'goBack', '`': 'nextSection', '~': 'prevSection', + '/': 'showSearch', '?': 'showHelpModal' // open keyboard shortcut help }, @@ -92,6 +92,11 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ this._changeSection(-1); }, + showSearch: function() { + $('#search-button').click(); + return false; + }, + showHelpModal: function() { Discourse.__container__.lookup('controller:application').send('showKeyboardShortcutsHelp'); },