From 1df24fe3542076a9a27142a1d46a9d776fd90870 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Tue, 10 Mar 2020 11:51:19 +0100 Subject: [PATCH] Modal: only add scrollbar spacing when there is a scrollbar --- app/assets/javascripts/app/lib/bootstrap/modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/lib/bootstrap/modal.js b/app/assets/javascripts/app/lib/bootstrap/modal.js index db78f289b..c53273872 100644 --- a/app/assets/javascripts/app/lib/bootstrap/modal.js +++ b/app/assets/javascripts/app/lib/bootstrap/modal.js @@ -257,8 +257,8 @@ left: this.$body.offset().left, top: this.$body.offset().top, width: this.$body.width(), - paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', - paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' + paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing && this.scrollbarWidth > 0 ? this.scrollbarWidth : '', + paddingRight: this.bodyIsOverflowing && !modalIsOverflowing && this.scrollbarWidth > 0 ? this.scrollbarWidth : '' } if(App.i18n.dir() == 'rtl'){