Skip to content

Commit

Permalink
feat(sheet): 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 da356cb commit 5fd5130
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/core/components/sheet/sheet-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,18 +466,18 @@ class Sheet extends Modal {
if (sheet.push) {
pushOffset = parseInt($el.css('--f7-sheet-push-offset'), 10);
if (Number.isNaN(pushOffset)) pushOffset = 0;
if (pushOffset) {
$el.addClass('sheet-modal-push');
sheet.$htmlEl.addClass('with-modal-sheet-push');
if (!sheet.params.swipeToStep) {
sheet.$htmlEl[0].style.setProperty('--f7-sheet-push-scale', pushViewScale(pushOffset));
} else {
$pushViewEl = app.$el.children('.view, .views');
pushBorderRadius = parseFloat(
$el.css(`border-${isTopSheetModal ? 'bottom' : 'top'}-left-radius`),
);
$pushViewEl.css('border-radius', '0px');
}
if (!pushOffset) pushOffset = app.theme === 'ios' ? 44 : 48;
sheet.$htmlEl[0].style.setProperty('--f7-sheet-push-offset', `${pushOffset}px`);
$el.addClass('sheet-modal-push');
sheet.$htmlEl.addClass('with-modal-sheet-push');
if (!sheet.params.swipeToStep) {
sheet.$htmlEl[0].style.setProperty('--f7-sheet-push-scale', pushViewScale(pushOffset));
} else {
$pushViewEl = app.$el.children('.view, .views');
pushBorderRadius = parseFloat(
$el.css(`border-${isTopSheetModal ? 'bottom' : 'top'}-left-radius`),
);
$pushViewEl.css('border-radius', '0px');
}
}
});
Expand Down Expand Up @@ -532,6 +532,7 @@ class Sheet extends Modal {
sheet.emit('local::_swipeStep', true);
if (sheet.push) {
sheet.$htmlEl[0].style.removeProperty('--f7-sheet-push-scale');
sheet.$htmlEl[0].style.removeProperty('--f7-sheet-push-offset');
}
};
sheet.stepToggle = function stepToggle() {
Expand Down

0 comments on commit 5fd5130

Please sign in to comment.