mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fixing single story mode issues.
This commit is contained in:
parent
3ed67cd07f
commit
69481b2bb7
3 changed files with 19 additions and 7 deletions
|
@ -218,17 +218,17 @@
|
|||
center = NEWSBLUR.reader.layout.rightLayout.panes.center;
|
||||
}
|
||||
if (center) {
|
||||
$windows.toggleClass('NB-narrow-content', center.width() < 780);
|
||||
var narrow = center.width() < 780;
|
||||
$windows.toggleClass('NB-narrow-content', narrow);
|
||||
this.flags.narrow_content = !!narrow;
|
||||
content_width = center.width() + (west ? west.width() : 0);
|
||||
}
|
||||
|
||||
if ((north && north.width() < 640) ||
|
||||
(content_width && content_width < 780)) {
|
||||
$windows.addClass('NB-narrow');
|
||||
this.flags.narrow_content = true;
|
||||
} else {
|
||||
$windows.removeClass('NB-narrow');
|
||||
this.flags.narrow_content = false;
|
||||
}
|
||||
|
||||
this.apply_tipsy_titles();
|
||||
|
|
|
@ -94,6 +94,11 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
|
|||
return this;
|
||||
},
|
||||
|
||||
setElement: function($el) {
|
||||
Backbone.View.prototype.setElement.call(this, $el);
|
||||
if (this.share_view) this.share_view.setElement($el);
|
||||
},
|
||||
|
||||
render_starred_tags: function() {
|
||||
if (this.model.get('starred')) {
|
||||
this.save_view.toggle_feed_story_save_dialog();
|
||||
|
|
|
@ -72,7 +72,7 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
|
||||
add: function(options) {
|
||||
if (!_.contains(['split', 'full'], NEWSBLUR.assets.preference('story_layout'))) return;
|
||||
|
||||
|
||||
if (options.added) {
|
||||
var collection = this.collection;
|
||||
var added = this.collection.models.slice(-1 * options.added);
|
||||
|
@ -204,17 +204,20 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
});
|
||||
},
|
||||
|
||||
show_only_selected_story: function() {
|
||||
show_only_selected_story: function(model, selected) {
|
||||
if (!NEWSBLUR.assets.preference('feed_view_single_story')) return;
|
||||
if (!_.contains(['split', 'full'], NEWSBLUR.assets.preference('story_layout'))) return;
|
||||
|
||||
if (!selected) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.clear_explainer();
|
||||
|
||||
this.collection.any(_.bind(function(story) {
|
||||
if (story && story.get('selected') && story.story_view) {
|
||||
this.$el.html(story.story_view.el);
|
||||
story.story_view.setElement(story.story_view.el);
|
||||
story.story_view.render();
|
||||
// story.story_view.render();
|
||||
return true;
|
||||
}
|
||||
}, this));
|
||||
|
@ -438,6 +441,7 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
var self = this;
|
||||
var stories = NEWSBLUR.assets.stories;
|
||||
if (!_.contains(['split', 'full'], NEWSBLUR.assets.preference('story_layout'))) return;
|
||||
if (NEWSBLUR.assets.preference('feed_view_single_story')) return;
|
||||
|
||||
// NEWSBLUR.log(['Prefetching Feed', this.flags['feed_view_positions_calculated'], this.is_feed_loaded_for_location_fetch()]);
|
||||
|
||||
|
@ -479,6 +483,7 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
var stories = NEWSBLUR.assets.stories;
|
||||
|
||||
if (!_.contains(['split', 'full'], NEWSBLUR.assets.preference('story_layout'))) return;
|
||||
if (NEWSBLUR.assets.preference('feed_view_single_story')) return;
|
||||
if (!stories || !stories.length) return;
|
||||
if (options.reset_timer) this.counts['positions_timer'] = 0;
|
||||
|
||||
|
@ -516,6 +521,7 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
|
||||
check_feed_view_scrolled_to_bottom: function() {
|
||||
if (!_.contains(['split', 'full'], NEWSBLUR.assets.preference('story_layout'))) return;
|
||||
if (NEWSBLUR.assets.preference('feed_view_single_story')) return;
|
||||
if (NEWSBLUR.assets.flags['no_more_stories']) return;
|
||||
if (!NEWSBLUR.assets.stories.size()) return;
|
||||
|
||||
|
@ -542,6 +548,7 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
|
||||
reset_story_positions: function(models) {
|
||||
if (!_.contains(['split', 'full'], NEWSBLUR.assets.preference('story_layout'))) return;
|
||||
if (NEWSBLUR.assets.preference('feed_view_single_story')) return;
|
||||
|
||||
if (!models || !models.length) {
|
||||
models = NEWSBLUR.assets.stories;
|
||||
|
|
Loading…
Add table
Reference in a new issue