Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
const iframe = iframeRef.current
iframeResize({ ...rest, onClose }, iframe)
return () => iframe.iframeResizer && iframe.iframeResizer.removeListeners()
}, []) // eslint-disable-line react-hooks/exhaustive-deps
ref={(el) => {
if (el && !this.iframeResizerInstantiated) {
iframeResizer({
checkOrigin: false,
scrolling: true
}, findDOMNode(el));
this.iframeResizerInstantiated = true;
}
}}
style={{
componentDidMount() {
const iFrameSelector = 'iframe[data-resize="enabled"]';
this.iframesToResize = document.queryAll(iFrameSelector).length;
this.retriggerHashNavigation();
iFrameResize({
resizedCallback: () => {
this.iframesToResize--;
this.retriggerHashNavigation();
}
}, iFrameSelector);
}
var elementIdSparkAppContainer = angularAppName + '-spark-app-container';
var appContainerAlreadyCreated = AJS.$('#' + elementIdSparkAppContainer).length > 0;
if (appContainerAlreadyCreated) {
AJS.$('#' + elementIdSparkAppContainer).remove();
}
AJS.$(element).append(sparkTemplates.appBootstrapContaineriFrame({
id: elementIdSparkAppContainer,
src: location.protocol + '//' + location.host + fullAppPath,
createOptions: AJS.$.extend(defaultDialogOptions, createOptions),
className: css.className
}));
iframeResizer([{
'autoResize': true,
'heightCalculationMethod': 'max'
}], AJS.$(element).find('iframe')[0]);
};
componentDidMount() {
const iFrameSelector = 'iframe[data-resize="enabled"]';
this.iframesToResize = document.queryAll(iFrameSelector).length;
this.retriggerHashNavigation();
iFrameResize({
resizedCallback: () => {
this.iframesToResize--;
this.retriggerHashNavigation();
}
}, iFrameSelector);
}