mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°6767 - Error in ajax request when there's dict to load and no onready scripts
This commit is contained in:
@@ -46,13 +46,20 @@
|
||||
{% if aPage.aJsFiles is not empty %}
|
||||
{% block iboPageJsFiles %}
|
||||
<script type="text/javascript">
|
||||
{% if bHasOnInitOrOnDomReadyScripts == false %}
|
||||
// Define a dummy empty callback if there's no script to execute
|
||||
let fOnJsFilesLoaded{{ sId }} = function (fResolve) {
|
||||
fResolve();
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
window['{{ sPromiseId }}'] = new Promise(function (fAllJsFilesResolve, fAllJsFilesReject) {
|
||||
/**
|
||||
* @type {Array} aJsFilesToLoad Files required by the current \AjaxPage
|
||||
*
|
||||
* For each file:
|
||||
* - "id": Used as an identifier to check if file is already being handled
|
||||
* - "url" is the URL that will be use for loading. It should include any relevant query args, including the cache buster
|
||||
* - "url" is the URL that will be used for loading. It should include any relevant query args, including the cache buster
|
||||
*
|
||||
* ```
|
||||
* [
|
||||
|
||||
Reference in New Issue
Block a user