Skip to content

Commit

Permalink
updated code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mirafedas committed Mar 7, 2024
1 parent 1abb46d commit b5acfcd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/blocks/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function sendViewportDimensionsOnRequest({ messageInfo, debounce }) {
}

/** For the modal height adjustment to work the following conditions must be met:
* 1. The modal must have classes 'commerce-frame height-fit-content';
* 1. The modal must have the class 'commerce-frame';
* 2. The iframe inside must send a postMessage with the contentHeight (a number of px or '100%);
*/
function adjustModalHeight({ contentHeight, dialog }) {
Expand Down Expand Up @@ -147,10 +147,10 @@ export async function adjustIframeStyles(dialog) {
return;
}

/* If the page inside iframe displays Trial with Purchase content with a subscription panel,
/* If the page inside iframe sens the postMessage with its content height,
we activate the height auto adjustment to eliminate the blank space at the bottom of the modal.
For this we set the iframe height to 0% in CSS to let the page inside iframe
to measure its content height properly, and send it in the postMessage.
to measure its content height properly.
Then we set the modal height to be the same as the content height we received. */
const isAutoHeightAdjustment = /\/mini-plans\/.*mid=ft.*web=1/.test(iframe.src); // matches e.g. https://www.adobe.com/mini-plans/photoshop.html?mid=ft&web=1
if (isAutoHeightAdjustment) {
Expand Down

0 comments on commit b5acfcd

Please sign in to comment.