Fix MailPoet content jumping when modal is shown
[MAILPOET-2788]
This commit is contained in:
@@ -453,16 +453,19 @@ MailPoet.Modal = {
|
||||
return this;
|
||||
},
|
||||
showOverlay: function () {
|
||||
var $body = jQuery('body');
|
||||
// Used to add space which was took by scrollbar when it's hidden by overflow:hidden
|
||||
var bodyInnerWidth = $body.innerWidth();
|
||||
if (!this.options.overlayRender) {
|
||||
return this;
|
||||
}
|
||||
jQuery('#mailpoet_modal_overlay').show();
|
||||
jQuery('body').addClass('mailpoet_modal_opened');
|
||||
jQuery('body').addClass('mailpoet_modal_opened').css('marginRight', $body.innerWidth() - bodyInnerWidth);
|
||||
return this;
|
||||
},
|
||||
hideOverlay: function () {
|
||||
jQuery('#mailpoet_modal_overlay').hide();
|
||||
jQuery('body').removeClass('mailpoet_modal_opened');
|
||||
jQuery('body').removeClass('mailpoet_modal_opened').css('marginRight', 0);
|
||||
return this;
|
||||
},
|
||||
popup: function (opts) {
|
||||
|
Reference in New Issue
Block a user