From a7c342ccb90f14d21220e0d582e7225429a8067a Mon Sep 17 00:00:00 2001 From: Kris Date: Mon, 20 Sep 2021 12:21:24 -0400 Subject: [PATCH] REFACTOR: move composer min-height to CSS (#14378) --- .../javascripts/discourse/app/components/composer-body.js | 2 -- app/assets/stylesheets/common/base/compose.scss | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/composer-body.js b/app/assets/javascripts/discourse/app/components/composer-body.js index d64a91cbd7c..3eb735066da 100644 --- a/app/assets/javascripts/discourse/app/components/composer-body.js +++ b/app/assets/javascripts/discourse/app/components/composer-body.js @@ -15,7 +15,6 @@ const START_EVENTS = "touchstart mousedown"; const DRAG_EVENTS = "touchmove mousemove"; const END_EVENTS = "touchend mouseup"; -const MIN_COMPOSER_SIZE = 240; const THROTTLE_RATE = 20; function mouseYPos(e) { @@ -121,7 +120,6 @@ export default Component.extend(KeyEnterEscape, { const winHeight = $(window).height(); size = Math.min(size, winHeight - headerHeight()); - size = Math.max(size, MIN_COMPOSER_SIZE); this.movePanels(size); $composer.height(size); }; diff --git a/app/assets/stylesheets/common/base/compose.scss b/app/assets/stylesheets/common/base/compose.scss index d0f409598d7..4a7fbfe9060 100644 --- a/app/assets/stylesheets/common/base/compose.scss +++ b/app/assets/stylesheets/common/base/compose.scss @@ -515,6 +515,12 @@ body.ios-safari-composer-hacks { body:not(.ios-safari-composer-hacks) { #reply-control.open { + --min-height: 255px; + min-height: var(--min-height); + &.composer-action-reply { + // we can let the reply composer get a little shorter + min-height: calc(var(--min-height) - 4em); + } padding-bottom: var(--composer-ipad-padding); } }