Fix MailPoet content jumping when modal is shown
[MAILPOET-2788]
This commit is contained in:
@@ -453,16 +453,19 @@ MailPoet.Modal = {
|
|||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
showOverlay: function () {
|
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) {
|
if (!this.options.overlayRender) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
jQuery('#mailpoet_modal_overlay').show();
|
jQuery('#mailpoet_modal_overlay').show();
|
||||||
jQuery('body').addClass('mailpoet_modal_opened');
|
jQuery('body').addClass('mailpoet_modal_opened').css('marginRight', $body.innerWidth() - bodyInnerWidth);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
hideOverlay: function () {
|
hideOverlay: function () {
|
||||||
jQuery('#mailpoet_modal_overlay').hide();
|
jQuery('#mailpoet_modal_overlay').hide();
|
||||||
jQuery('body').removeClass('mailpoet_modal_opened');
|
jQuery('body').removeClass('mailpoet_modal_opened').css('marginRight', 0);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
popup: function (opts) {
|
popup: function (opts) {
|
||||||
|
Reference in New Issue
Block a user