Skip to content

Commit

Permalink
feat(popup): use push effect even if no safe areas detected
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Oct 14, 2022
1 parent a5af755 commit da356cb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/core/components/popup/popup-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,14 @@ class Popup extends Modal {
}
if (isPush) {
pushOffset = parseInt($el.css('--f7-popup-push-offset'), 10);
if (Number.isNaN(pushOffset)) pushOffset = 0;
if (pushOffset) {
$el.addClass('popup-push');
popup.$htmlEl.addClass('with-modal-popup-push');
popup.$htmlEl[0].style.setProperty('--f7-popup-push-scale', pushViewScale(pushOffset));
if (Number.isNaN(pushOffset)) {
pushOffset = 0;
}
if (!pushOffset) pushOffset = app.theme === 'ios' ? 44 : 48;
popup.$htmlEl[0].style.setProperty('--f7-popup-push-offset', `${pushOffset}px`);
$el.addClass('popup-push');
popup.$htmlEl.addClass('with-modal-popup-push');
popup.$htmlEl[0].style.setProperty('--f7-popup-push-scale', pushViewScale(pushOffset));
}
app.on('resize', updatePushOffset);
};
Expand Down Expand Up @@ -384,6 +386,7 @@ class Popup extends Modal {
if (isPush && pushOffset && !hasPreviousPushPopup) {
popup.$htmlEl.removeClass('with-modal-popup-push-closing');
popup.$htmlEl[0].style.removeProperty('--f7-popup-push-scale');
popup.$htmlEl[0].style.removeProperty('--f7-popup-push-offset');
}
});

Expand Down

0 comments on commit da356cb

Please sign in to comment.