mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Merge remote-tracking branch 'origin/support/3.1' into develop
This commit is contained in:
@@ -67,6 +67,8 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
CombodoJsActivity.AddOngoingScript();
|
||||
|
||||
// Form field set declaration
|
||||
var oFieldSet_{{ sFormIdSanitized }} = $('#{{ sFormId }} > .form_fields').field_set({{ form.fieldset|json_encode()|raw }});
|
||||
// Form handler declaration
|
||||
@@ -149,5 +151,7 @@
|
||||
$('#{{ sFormId }}').closest('.modal').scrollTop(0);
|
||||
$('#{{ sFormId }}').closest('.modal').find('.modal-footer').hide();
|
||||
{% endif %}
|
||||
|
||||
CombodoJsActivity.RemoveOngoingScript();
|
||||
});
|
||||
</script>
|
||||
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
|
||||
*
|
||||
|
||||
@@ -254,14 +254,14 @@ JS
|
||||
protected function GetReadyScriptsStartedTrigger(): ?string
|
||||
{
|
||||
return <<<JS
|
||||
$("body").attr("data-ready-scripts", "start");
|
||||
CombodoJsActivity.AddOngoingScript();
|
||||
JS;
|
||||
}
|
||||
|
||||
protected function GetReadyScriptsFinishedTrigger(): ?string
|
||||
{
|
||||
return <<<JS
|
||||
$("body").attr("data-ready-scripts", "done");
|
||||
CombodoJsActivity.RemoveOngoingScript();
|
||||
JS;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user