Opening share dialog in story titles if easier.

This commit is contained in:
Samuel Clay 2013-04-03 13:25:17 -07:00
parent c4ad789263
commit aeabb2171e
5 changed files with 22 additions and 10 deletions

View file

@ -5834,9 +5834,9 @@ form.opml_import_form input {
width: 100%; width: 100%;
} }
.NB-menu-manage .NB-menu-manage-confirm .NB-menu-manage-story-share-unshare { .NB-menu-manage .NB-menu-manage-confirm .NB-menu-manage-story-share-unshare {
width: 95%; width: 100%;
text-align: center; text-align: center;
margin-bottom: 0; margin: 4px 0 0;
} }
.NB-menu-manage .NB-menu-manage-confirm .NB-sideoption-share-comments { .NB-menu-manage .NB-menu-manage-confirm .NB-sideoption-share-comments {
height: 28px; height: 28px;

View file

@ -59,11 +59,18 @@ NEWSBLUR.Models.Story = Backbone.Model.extend({
window.focus(); window.focus();
}, },
open_share_dialog: function(e) { open_share_dialog: function(e, view) {
var $story = this.latest_story_detail_view.$el; if (view == 'title') {
this.latest_story_detail_view.share_view.toggle_feed_story_share_dialog({ var $story_title = this.story_title_view.$st;
animate_scroll: true this.story_title_view.mouseenter_manage_icon();
}); NEWSBLUR.reader.show_manage_menu('story', $story_title, {story_id: this.id});
NEWSBLUR.reader.show_confirm_story_share_menu_item(this.id);
} else {
var $story = this.latest_story_detail_view.$el;
this.latest_story_detail_view.share_view.toggle_feed_story_share_dialog({
animate_scroll: true
});
}
}, },
change_selected: function(model, selected) { change_selected: function(model, selected) {

View file

@ -5591,7 +5591,12 @@
$document.bind('keydown', 'shift+s', function(e) { $document.bind('keydown', 'shift+s', function(e) {
e.preventDefault(); e.preventDefault();
if (self.active_story) { if (self.active_story) {
self.active_story.open_share_dialog(e); var view = 'feed';
if (NEWSBLUR.assets.preference('story_layout') == 'split' &&
_.contains(['page', 'story'], self.story_view)) {
view = 'title';
}
self.active_story.open_share_dialog(e, view);
} }
}); });
} }

View file

@ -127,8 +127,7 @@ NEWSBLUR.Views.StoryShareView = Backbone.View.extend({
queue: false, queue: false,
easing: 'easeInOutQuint', easing: 'easeInOutQuint',
offset: this.model.latest_story_detail_view.$el.height() - offset: this.model.latest_story_detail_view.$el.height() -
$scroll_container.height() + $scroll_container.height()
dialog_height
}); });
} }
$share.animate({ $share.animate({

View file

@ -302,6 +302,7 @@ NEWSBLUR.Views.StoryTitleView = Backbone.View.extend({
mouseenter_manage_icon: function() { mouseenter_manage_icon: function() {
var menu_height = 270; var menu_height = 270;
// console.log(["mouseenter_manage_icon", this.$el.offset().top, $(window).height(), menu_height]);
if (this.$el.offset().top > $(window).height() - menu_height) { if (this.$el.offset().top > $(window).height() - menu_height) {
this.$st.addClass('NB-hover-inverse'); this.$st.addClass('NB-hover-inverse');
} }