mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Scrolling to selected story when re-opening hidden story titles pane. Thanks @afita.
This commit is contained in:
parent
9885e943bb
commit
95326cc835
3 changed files with 13 additions and 4 deletions
|
@ -2448,6 +2448,7 @@
|
|||
NEWSBLUR.reader.layout.rightLayout.open(story_anchor);
|
||||
this.resize_window();
|
||||
this.flags['story_titles_closed'] = false;
|
||||
NEWSBLUR.app.story_titles.scroll_to_selected_story();
|
||||
},
|
||||
|
||||
// =======================
|
||||
|
|
|
@ -221,7 +221,7 @@ NEWSBLUR.ReaderKeyboard.prototype = {
|
|||
]),
|
||||
$.make('div', { className: 'NB-keyboard-group' }, [
|
||||
$.make('div', { className: 'NB-keyboard-shortcut' }, [
|
||||
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'Hide Sidebar'),
|
||||
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'Hide Sites'),
|
||||
$.make('div', { className: 'NB-keyboard-shortcut-key' }, [
|
||||
'shift',
|
||||
$.make('span', '+'),
|
||||
|
@ -229,9 +229,11 @@ NEWSBLUR.ReaderKeyboard.prototype = {
|
|||
])
|
||||
]),
|
||||
$.make('div', { className: 'NB-keyboard-shortcut NB-last' }, [
|
||||
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'View keyboard shortcuts'),
|
||||
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'Hide Story titles'),
|
||||
$.make('div', { className: 'NB-keyboard-shortcut-key' }, [
|
||||
'?'
|
||||
'shift',
|
||||
$.make('span', '+'),
|
||||
't'
|
||||
])
|
||||
])
|
||||
]),
|
||||
|
@ -244,6 +246,12 @@ NEWSBLUR.ReaderKeyboard.prototype = {
|
|||
$.make('div', { className: 'NB-keyboard-shortcut-key' }, [
|
||||
'-'
|
||||
])
|
||||
]),
|
||||
$.make('div', { className: 'NB-keyboard-shortcut NB-last' }, [
|
||||
$.make('div', { className: 'NB-keyboard-shortcut-explanation' }, 'View keyboard shortcuts'),
|
||||
$.make('div', { className: 'NB-keyboard-shortcut-key' }, [
|
||||
'?'
|
||||
])
|
||||
])
|
||||
])
|
||||
]);
|
||||
|
|
|
@ -176,7 +176,7 @@ NEWSBLUR.Views.StoryTitlesView = Backbone.View.extend({
|
|||
// ============
|
||||
|
||||
scroll_to_selected_story: function(story) {
|
||||
var story_title_view = story.story_title_view || this.collection.active_story.story_title_view;
|
||||
var story_title_view = story && story.story_title_view || this.collection.active_story.story_title_view;
|
||||
var story_title_visisble = NEWSBLUR.reader.$s.$story_titles.isScrollVisible(story_title_view.$el);
|
||||
if (!story_title_visisble) {
|
||||
var container_offset = NEWSBLUR.reader.$s.$story_titles.position().top;
|
||||
|
|
Loading…
Add table
Reference in a new issue