mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 14:24:24 +00:00
Debug When leaving a report form page without modification, warning pop up is shown - refs #391
This commit is contained in:
parent
a327f581c5
commit
fdf6ac0bbf
@ -29,23 +29,10 @@
|
|||||||
<button class="sc-button red margin-10" type="reset"><i class="fa fa-eraser"></i> {{ 'Reset report'|trans }}</button>
|
<button class="sc-button red margin-10" type="reset"><i class="fa fa-eraser"></i> {{ 'Reset report'|trans }}</button>
|
||||||
</div>
|
</div>
|
||||||
{{ form_end(edit_form) }}
|
{{ form_end(edit_form) }}
|
||||||
|
{% endblock %}
|
||||||
<script type="text/javascript">
|
|
||||||
var form = $("form[name='{{ edit_form.vars.form.vars.name }}']").data('serialize',$("form[name='{{ edit_form.vars.form.vars.name }}']").serialize());
|
|
||||||
// On load save form current state
|
|
||||||
var submittedOk{{ edit_form.vars.form.vars.name }} = false;
|
|
||||||
form.bind('submit', function(e) {
|
|
||||||
submittedOk{{ edit_form.vars.form.vars.name }} = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
$(window).bind('beforeunload', function(e){
|
{% block js %}
|
||||||
if($("form[name='{{ edit_form.vars.form.vars.name }}']").serialize()!=$("form[name='{{ edit_form.vars.form.vars.name }}']").data('serialize')){
|
<script type="text/javascript">
|
||||||
if (submittedOk{{ edit_form.vars.form.vars.name }} == false) {
|
chill.protectUnsavedDataForFrom('form[name="{{ edit_form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
|
||||||
return "{{ 'You are going to leave a page with unsubmitted data. Are you sure you want to leave ?'|trans }}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
e=null;
|
|
||||||
// i.e; if form state change show box not.
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -29,22 +29,10 @@
|
|||||||
<button class="sc-button red margin-10" type="reset"><i class="fa fa-eraser"></i> {{ 'Reset report'|trans }}</button>
|
<button class="sc-button red margin-10" type="reset"><i class="fa fa-eraser"></i> {{ 'Reset report'|trans }}</button>
|
||||||
</div>
|
</div>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
<script type="text/javascript">
|
{% endblock %}
|
||||||
var form = $("form[name='{{ form.vars.form.vars.name }}']").data('serialize',$("form[name='{{ form.vars.form.vars.name }}']").serialize());
|
|
||||||
// On load save form current state
|
|
||||||
var submittedOk{{ form.vars.form.vars.name }} = false;
|
|
||||||
form.bind('submit', function(e) {
|
|
||||||
submittedOk{{ form.vars.form.vars.name }} = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
$(window).bind('beforeunload', function(e){
|
{% block js %}
|
||||||
if($("form[name='{{ form.vars.form.vars.name }}']").serialize()!=$("form[name='{{ form.vars.form.vars.name }}']").data('serialize')){
|
<script type="text/javascript">
|
||||||
if (submittedOk{{ form.vars.form.vars.name }} == false) {
|
chill.protectUnsavedDataForFrom('form[name="{{ form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
|
||||||
return "{{ 'You are going to leave a page with unsubmitted data. Are you sure you want to leave ?'|trans }}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
e=null;
|
|
||||||
// i.e; if form state change show box not.
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user