Hi!
How can I reuse this script in my component?
I insert in component template
$wa = $this->document->getWebAssetManager();
$wa->registerAndUseScript('com_wrapper.iframe', 'com_wrapper/iframe-height.min.js', [], ['defer' => true]);
And render iframe
<div class="com-wrapper contentpane">
<?php echo HTMLHelper::_(
'iframe',
Route::_('index.php?option=com_jcomments&view=form&tmpl=component'),
'commentsFormFrame',
array('width' => '100%', 'class' => 'com-wrapper__iframe wrapper')
); ?>
</div>
But the iframe height still the same as initial. Any ideas?