N°3123 : Improved JavaScript management in web pages and ajax pages

This commit is contained in:
acognet
2020-12-08 08:59:01 +01:00
parent 0808a76226
commit 5ccb12453a
11 changed files with 185 additions and 65 deletions

View File

@@ -716,15 +716,10 @@ class WebPage implements Page
public function RenderInlineScriptsAndCSSRecursively(iUIBlock $oBlock): void
{
$oBlockRenderer = new BlockRenderer($oBlock);
$sInlineScript = trim($oBlockRenderer->RenderJsInline());
if (!empty($sInlineScript)) {
$this->add_script($sInlineScript);
}
$this->add_script($oBlockRenderer->RenderJsInline(iUIBlock::JS_TYPE_ON_INIT));
$this->add_script($oBlockRenderer->RenderJsInline(iUIBlock::JS_TYPE_LIVE));
$sInlineStyle = trim($oBlockRenderer->RenderCssInline());
if (!empty($sInlineStyle)) {
$this->add_style($sInlineStyle);
}
$this->add_style($oBlockRenderer->RenderCssInline());
foreach ($oBlock->GetSubBlocks() as $oSubBlock) {
$this->RenderInlineScriptsAndCSSRecursively($oSubBlock);