[DE PE SSE mobile] Fix Bug 59989

This commit is contained in:
SergeyEzhin 2022-12-02 15:09:10 +04:00
parent 51f0bfa089
commit e749085682

View file

@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { Navbar, Page } from 'framework7-react';
import { useTranslation } from 'react-i18next';
@ -7,15 +7,20 @@ const ViewSharingSettings = props => {
const sharingSettingsUrl = props.sharingSettingsUrl;
const _t = t('Common.Collaboration', {returnObjects: true});
function resizeHeightIframe(iFrame) {
function resizeHeightIframe(selector) {
const iFrame = document.querySelector(selector);
iFrame.height = iFrame.contentWindow.document.body.scrollHeight;
};
useEffect(() => {
resizeHeightIframe('#sharing-placeholder iframe');
}, []);
return (
<Page>
<Navbar title={t('Common.Collaboration.textSharingSettings')} backLink={_t.textBack} />
<div id="sharing-placeholder" className="sharing-placeholder">
<iframe width="100%" frameBorder={0} scrolling="0" align="top" src={sharingSettingsUrl} onLoad={resizeHeightIframe(this)}></iframe>
<iframe width="100%" frameBorder={0} scrolling="0" align="top" src={sharingSettingsUrl}></iframe>
</div>
</Page>
)