Fixing last few story_view bugs.

This commit is contained in:
Samuel Clay 2013-02-12 16:07:01 -08:00
parent 8c53ba015c
commit 174c837271
4 changed files with 10 additions and 10 deletions

View file

@ -52,7 +52,12 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({
}
NEWSBLUR.reader.update_starred_count();
},
open_story_in_new_tab: function() {
this.mark_read({skip_delay: true});
window.open(this.get('story_permalink'), '_blank');
window.focus();
},
change_selected: function(model, selected) {
if (model.collection) {

View file

@ -4908,7 +4908,7 @@
if (!self.flags['showing_confirm_input_on_manage_menu']) {
var story_id = $t.closest('.NB-menu-manage-story').data('story_id');
var story = self.model.get_story(story_id);
story.story_view.open_story_in_new_tab();
story.open_story_in_new_tab();
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-story-star' }, function($t, $p){
@ -5454,7 +5454,7 @@
var story_id = self.active_story;
if (!story_id) return;
var story = self.model.get_story(story_id);
story.story_view.open_story_in_new_tab();
story.open_story_in_new_tab();
});
$document.bind('keypress', 'e', function(e) {
e.preventDefault();

View file

@ -48,6 +48,7 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
!this.options.inline_story_title) {
this.model.story_view = this;
} else if (this.options.inline_story_title) {
this.model.story_view = this;
this.model.inline_story_detail_view = this;
}
},
@ -610,12 +611,6 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
this.model.star_story();
},
open_story_in_new_tab: function() {
this.model.mark_read({skip_delay: true});
window.open(this.model.get('story_permalink'), '_blank');
window.focus();
},
scroll_to_comments: function() {
NEWSBLUR.app.story_list.scroll_to_selected_story(this.model, {
scroll_to_comments: true,

View file

@ -251,7 +251,7 @@ NEWSBLUR.Views.StoryTitleView = Backbone.View.extend({
this.model.set('selected', true, {'click_on_story_title': true});
if (NEWSBLUR.hotkeys.command) {
this.model.story_view.open_story_in_new_tab();
this.model.open_story_in_new_tab();
}
},