diff --git a/sources/application/UI/Base/Component/Dashlet/DashletBadge.php b/sources/application/UI/Base/Component/Dashlet/DashletBadge.php
index 736895f2d..34024450c 100644
--- a/sources/application/UI/Base/Component/Dashlet/DashletBadge.php
+++ b/sources/application/UI/Base/Component/Dashlet/DashletBadge.php
@@ -16,7 +16,7 @@ class DashletBadge extends DashletContainer
public const BLOCK_CODE = 'ibo-dashlet-badge';
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/dashlet/dashlet-badge';
- public const DEFAULT_JS_TEMPLATE_REL_PATH = 'base/components/dashlet/dashlet-badge';
+ public const DEFAULT_JS_ON_READY_TEMPLATE_REL_PATH = 'base/components/dashlet/dashlet-badge';
public const DEFAULT_JS_FILES_REL_PATH = [
'js/components/dashlet/dashlet-badge.js',
];
diff --git a/sources/application/UI/Base/UIBlock.php b/sources/application/UI/Base/UIBlock.php
index 7d565e3f3..eeb2316e4 100644
--- a/sources/application/UI/Base/UIBlock.php
+++ b/sources/application/UI/Base/UIBlock.php
@@ -43,7 +43,11 @@ abstract class UIBlock implements iUIBlock
public const DEFAULT_GLOBAL_TEMPLATE_REL_PATH = null;
/** @var string|null */
public const DEFAULT_HTML_TEMPLATE_REL_PATH = null;
- /** @var array */
+ /**
+ * @var array list of external JS file paths to include in the page. Paths are relative to APPROOT
+ * **Warning** : if you need to call a JS var defined in one of this file, then this calling code MUST be in {@see DEFAULT_JS_ON_READY_TEMPLATE_REL_PATH}
+ * and not in {@see DEFAULT_JS_TEMPLATE_REL_PATH} ! Indeed the later is output before external files loading.
+ */
public const DEFAULT_JS_FILES_REL_PATH = [];
/** @var string|null */
public const DEFAULT_JS_TEMPLATE_REL_PATH = null;
diff --git a/sources/application/WebPage/AjaxPage.php b/sources/application/WebPage/AjaxPage.php
index bbc2272d0..3bcee0fc4 100644
--- a/sources/application/WebPage/AjaxPage.php
+++ b/sources/application/WebPage/AjaxPage.php
@@ -237,19 +237,6 @@ EOF
echo "\n\n";
}
- //echo $this->s_deferred_content;
- if (count($this->a_scripts) > 0) {
- echo "\n";
- }
- if (count($this->a_linked_scripts) > 0) {
- echo "\n";
- }
if (!empty($this->s_deferred_content)) {
echo "\n";
}
- if (count($this->a_linked_stylesheets) > 0) {
- echo "\n";
- }
if (trim($s_captured_output) != "") {
echo self::FilterXSS($s_captured_output);
diff --git a/templates/base/components/dashlet/dashlet-badge.js.twig b/templates/base/components/dashlet/dashlet-badge.ready.js.twig
similarity index 100%
rename from templates/base/components/dashlet/dashlet-badge.js.twig
rename to templates/base/components/dashlet/dashlet-badge.ready.js.twig