From b5ca30bf564970e105a6c0697ff2717621fd4dc3 Mon Sep 17 00:00:00 2001 From: Erick Guan Date: Sat, 1 Mar 2014 16:05:30 +0000 Subject: [PATCH] poster_expansion will only slide down now. --- .../discourse/views/poster_expansion_view.js | 12 +++++++++--- app/assets/stylesheets/desktop/poster_expansion.scss | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/views/poster_expansion_view.js b/app/assets/javascripts/discourse/views/poster_expansion_view.js index ce7f691d197..dffcbbf38b6 100644 --- a/app/assets/javascripts/discourse/views/poster_expansion_view.js +++ b/app/assets/javascripts/discourse/views/poster_expansion_view.js @@ -15,7 +15,7 @@ Discourse.PosterExpansionView = Discourse.View.extend({ // Position the expansion when the post changes _visibleChanged: function() { var post = this.get('controller.model'), - self = this; + div = this.$(); Em.run.schedule('afterRender', function() { if (post) { @@ -25,8 +25,14 @@ Discourse.PosterExpansionView = Discourse.View.extend({ if (position) { position.left += $avatar.width() + 5; - self.$().css(position); + div.css(position); } + + var maxWidth = div.width(); + if (maxWidth < 250) { + maxWidth = 250; + } + div.css({ maxWidth: maxWidth }); } }); @@ -52,4 +58,4 @@ Discourse.PosterExpansionView = Discourse.View.extend({ $('html').off(clickOutsideEventName); } -}); \ No newline at end of file +}); diff --git a/app/assets/stylesheets/desktop/poster_expansion.scss b/app/assets/stylesheets/desktop/poster_expansion.scss index 5a794191b44..5cd0c059b65 100644 --- a/app/assets/stylesheets/desktop/poster_expansion.scss +++ b/app/assets/stylesheets/desktop/poster_expansion.scss @@ -11,9 +11,10 @@ margin-top: -2px; background-color: $primary_background_color; padding: 12px 12px 5px 12px; - max-width: 350px; h1 { + display: inline-block; + min-width: 120px; font-size: 30px; line-height: 33px; margin-bottom: 8px;