mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°3685 - Performance checks on the front end - Minimize size of generated javascript
This commit is contained in:
@@ -35,7 +35,14 @@
|
||||
{% set sId = oLayout.GetId() | sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME')) %}
|
||||
{% block iboPageJsFiles %}
|
||||
<script type="text/javascript">
|
||||
window['{{ sPromiseId }}'] = new Promise(function(resolve, reject){
|
||||
window['{{ sPromiseId }}'] = new Promise(function (resolve, reject) {
|
||||
let fInlineOnDomReadyScript{{ sId }} = function () {
|
||||
{% for sJsInlineOnDomReady in aPage.aJsInlineOnDomReady %}
|
||||
{{ sJsInlineOnDomReady|raw }}
|
||||
{% endfor %}
|
||||
resolve();
|
||||
}
|
||||
|
||||
let aFilesToLoad{{ sId }} = [];
|
||||
|
||||
{% for sJsFile in aPage.aJsFiles %}
|
||||
@@ -66,10 +73,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
{% for sJsInlineOnDomReady in aPage.aJsInlineOnDomReady %}
|
||||
{{ sJsInlineOnDomReady|raw }}
|
||||
{% endfor %}
|
||||
resolve();
|
||||
fInlineOnDomReadyScript{{ sId }}();
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -77,10 +81,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
{% for sJsInlineOnDomReady in aPage.aJsInlineOnDomReady %}
|
||||
{{ sJsInlineOnDomReady|raw }}
|
||||
{% endfor %}
|
||||
resolve();
|
||||
fInlineOnDomReadyScript{{ sId }}();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user