FIX: refactor padding when exiting composer

Previously, when existing composer, the `#main-outlet` element padding was set to zero. This inline style would override any CSS set for that element, causing issues with the mobile footer nav.

The fix removes the inline padding style instead of setting it to zero. It also uses integers for the set values, and removes a duplicate style.
This commit is contained in:
Penar Musaraj 2019-04-24 10:26:11 -04:00
parent 84b21e3ad6
commit 1a8c6577e0
2 changed files with 5 additions and 7 deletions

View File

@ -45,8 +45,8 @@ export default Ember.Component.extend(KeyEnterEscape, {
return composeState || Composer.CLOSED;
},
movePanels(sizePx) {
$("#main-outlet").css("padding-bottom", sizePx);
movePanels(size) {
$("#main-outlet").css("padding-bottom", size ? size : "");
// signal the progress bar it should move!
this.appEvents.trigger("composer:resized");
@ -64,7 +64,7 @@ export default Ember.Component.extend(KeyEnterEscape, {
}
const h = $("#reply-control").height() || 0;
this.movePanels(h + "px");
this.movePanels(h);
});
},
@ -111,9 +111,8 @@ export default Ember.Component.extend(KeyEnterEscape, {
const winHeight = Ember.$(window).height();
size = Math.min(size, winHeight - headerHeight());
size = Math.max(size, MIN_COMPOSER_SIZE);
const sizePx = `${size}px`;
this.movePanels(sizePx);
$composer.height(sizePx);
this.movePanels(size);
$composer.height(size);
};
const throttledPerformDrag = (event => {

View File

@ -912,7 +912,6 @@ export default Ember.Component.extend({
_composerClosed() {
this.appEvents.trigger("composer:will-close");
Ember.run.next(() => {
$("#main-outlet").css("padding-bottom", 0);
// need to wait a bit for the "slide down" transition of the composer
Ember.run.later(
() => this.appEvents.trigger("composer:closed"),