diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_create.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_create.html.twig index edd26d5a0..bdad93978 100644 --- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_create.html.twig +++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_create.html.twig @@ -67,6 +67,8 @@ \ No newline at end of file diff --git a/js/utils.js b/js/utils.js index 7747f173c..f2db91286 100644 --- a/js/utils.js +++ b/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 * diff --git a/sources/Application/WebPage/NiceWebPage.php b/sources/Application/WebPage/NiceWebPage.php index b6be27a96..6a2c15928 100644 --- a/sources/Application/WebPage/NiceWebPage.php +++ b/sources/Application/WebPage/NiceWebPage.php @@ -254,14 +254,14 @@ JS protected function GetReadyScriptsStartedTrigger(): ?string { return <<