From b3a5381e79d69e1157a577f13b1de64f5bc1368c Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 11 Aug 2015 11:24:07 +0800 Subject: [PATCH] FIX: Get composer height after transition. --- app/assets/javascripts/discourse/views/composer.js.es6 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/views/composer.js.es6 b/app/assets/javascripts/discourse/views/composer.js.es6 index 865daa886ee..0ab45500a83 100644 --- a/app/assets/javascripts/discourse/views/composer.js.es6 +++ b/app/assets/javascripts/discourse/views/composer.js.es6 @@ -532,10 +532,13 @@ const ComposerView = Discourse.View.extend(Ember.Evented, { const self = this; Em.run.next(() => { - const sizePx = self.get('composeState') === Discourse.Composer.CLOSED ? 0 : $('#reply-control').height(); - $('#main-outlet').css('padding-bottom', sizePx); + $('#main-outlet').css('padding-bottom', 0); // need to wait a bit for the "slide down" transition of the composer Em.run.later(() => { + if (self.get('composeState') !== Discourse.Composer.CLOSED) { + $('#main-outlet').css('padding-bottom', $('#reply-control').height()); + } + this.appEvents.trigger("composer:closed"); }, 400); });