Adding in x keyboard shortcut for expanding and collapsing a story.

This commit is contained in:
Samuel Clay 2013-06-10 15:00:18 -07:00
parent 78e2e399dd
commit ab39fe7564
2 changed files with 21 additions and 2 deletions

View file

@ -5491,6 +5491,15 @@
});
});
$document.bind('keydown', 'x', function(e) {
e.preventDefault();
var story = NEWSBLUR.reader.active_story;
if (story && story.get('selected')) {
NEWSBLUR.reader.active_story.story_title_view.collapse_story();
} else if (story && !story.get('selected')) {
NEWSBLUR.reader.active_story.set('selected', true);
}
});
$document.bind('keydown', 'shift+x', function(e) {
e.preventDefault();
NEWSBLUR.reader.active_story.story_view.expand_story();
});

View file

@ -233,13 +233,15 @@ _.extend(NEWSBLUR.ReaderKeyboard.prototype, {
$.make('div', { className: 'NB-keyboard-shortcut' }, [
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'Expand story'),
$.make('div', { className: 'NB-keyboard-shortcut-key' }, [
'shift',
$.make('span','+'),
'x'
])
]),
$.make('div', { className: 'NB-keyboard-shortcut NB-last' }, [
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'Scroll to comments'),
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'Collapse story'),
$.make('div', { className: 'NB-keyboard-shortcut-key' }, [
'c'
'x'
])
])
]),
@ -311,6 +313,14 @@ _.extend(NEWSBLUR.ReaderKeyboard.prototype, {
'f'
])
])
]),
$.make('div', { className: 'NB-keyboard-group' }, [
$.make('div', { className: 'NB-keyboard-shortcut' }, [
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'Scroll to comments'),
$.make('div', { className: 'NB-keyboard-shortcut-key' }, [
'c'
])
])
])
]);
},