FEATURE: make # more useful for keyboard users

This commit is contained in:
Sam 2014-07-30 12:16:11 +10:00
parent b143b64511
commit e227b68f8d
2 changed files with 8 additions and 2 deletions

View File

@ -4,10 +4,16 @@ export default Ember.ObjectController.extend({
expanded: false,
actions: {
toggleExpansion: function() {
toggleExpansion: function(opts) {
this.toggleProperty('expanded');
if (this.get('expanded')) {
this.set('toPostNumber', this.get('progressPosition'));
if(opts && opts.highlight){
// TODO: somehow move to view?
Em.run.next(function(){
$('.jump-form input').select().focus();
});
}
}
},

View File

@ -134,7 +134,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
},
toggleProgress: function() {
Discourse.__container__.lookup('controller:topic-progress').send('toggleExpansion');
Discourse.__container__.lookup('controller:topic-progress').send('toggleExpansion', {highlight: true});
},
showSearch: function(selectContext) {