mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
Merge remote-tracking branch 'origin/support/3.0' into support/3.1
This commit is contained in:
28
js/utils.js
28
js/utils.js
@@ -1137,6 +1137,34 @@ const CombodoJSConsole = {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to reflect ongoing JS activity to other processes like BeHat
|
||||
* @api
|
||||
* @since 3.0.4 3.1.1 3.2.0 N°6765
|
||||
*/
|
||||
const CombodoJsActivity = {
|
||||
BODY_DATA_ATTR_NAME_READY: "data-ready-scripts",
|
||||
|
||||
/**
|
||||
* Counter so that we set the flag as done only on the last call
|
||||
* @type number
|
||||
*/
|
||||
iOngoingScriptsCount: 0,
|
||||
|
||||
AddOngoingScript: function() {
|
||||
this.iOngoingScriptsCount++;
|
||||
$("body").attr(this.BODY_DATA_ATTR_NAME_READY, "start");
|
||||
},
|
||||
|
||||
RemoveOngoingScript: function() {
|
||||
this.iOngoingScriptsCount--;
|
||||
|
||||
if (this.iOngoingScriptsCount < 1) {
|
||||
$("body").attr(this.BODY_DATA_ATTR_NAME_READY, "done");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to Sanitize string
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user