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