PHRAS-2761 #comment Port of PHRAS-2801 (Fix on firefox)

This commit is contained in:
Harrys Ravalomanana
2019-10-29 18:11:46 +04:00
parent df86aac2ba
commit 02e670880d

View File

@@ -176,25 +176,32 @@
emptying = true;
f();
});
var data;
//add lazaret file click action
$("button.add-lazaret", scope).bind('click', function () {
var that = $(this);
var lazaretId = getLazaretId(that);
var destinationCollectionId = getDestinationId(that);
var container = $(this).closest('.wrapper-item');
var form = $(this).closest("form");
/*fix POST on firefox*/
data = form.serializeArray();
var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html();
that.closest(".form-backup ").append(allData);
that.parent().closest('.wrapper-item').find(".change-record ").remove();
$.ajax({
type: 'POST',
url: '/prod/lazaret/' + lazaretId + '/force-add/',
dataType: 'json',
data: form.serializeArray(),
data: data,
beforeSend: function () {
startAjax(that);
},
success: function (data) {
if (data.success) {
that.closest(".wrapper-item").remove();
container.remove();
} else {
var html = _.template($("#alert_error_tpl").html(), {
content: data.message
@@ -219,6 +226,12 @@
$("button.delete-lazaret", scope).bind('click', function () {
var that = $(this);
var lazaretId = getLazaretId(that);
var container = $(this).closest('.wrapper-item');
var form = $(this).closest("form");
data = form.serializeArray();
var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html();
that.closest(".form-backup ").append(allData);
that.parent().closest('.wrapper-item').find(".change-record ").remove();
$.ajax({
type: 'POST',
@@ -229,7 +242,7 @@
},
success: function (data) {
if (data.success) {
that.closest(".wrapper-item").remove();
container.remove();
} else {
var html = _.template($("#alert_error_tpl").html(), {
content: data.message
@@ -362,17 +375,24 @@
var form = $(this).closest("form");
$(".record_id").val(recordId);
var form = $(this).closest("form");
data = form.serializeArray();
var allData = that.parent().closest('.wrapper-item').find(".change-record-wrapper").html();
that.closest(".form-backup ").append(allData);
that.parent().closest('.wrapper-item').find(".change-record ").remove();
$.ajax({
type: 'POST',
url: '/prod/lazaret/' + lazaretId + '/accept/',
dataType: 'json',
data: form.serializeArray(),
data: data,
beforeSend: function () {
startAjax(that);
},
success: function (data) {
if (data.success) {
that.closest(".wrapper-item").remove();
container.remove();
} else {
var html = _.template($("#alert_error_tpl").html(), {
content: data.message
@@ -425,7 +445,8 @@
<p>{{ border_checker_from_fqcn(check.getCheckClassname()).getMessage(app['translator']) }}</p>
{% endfor %}
</div>
<form name="change-records-status" action="/" method="POST">
<form class="change-record" name="change-records-status" action="/" method="POST">
<div class="change-record-wrapper">
{% set collection = file.getCollection(app) %}
<input type="hidden" name="bas_id" value="{{ collection.get_base_id() }}">
<input type="hidden" name="keep_attributes" value="1">
@@ -497,10 +518,12 @@
</button>
{% endif %}
</div>
</div>
</form>
<div class="hidden form-backup"></div>
{# bloc to backup initial value of status list#}
<table class="hidden">
<tbody class="status-backup"
<tbody class="status-backup">
{% if file.getStatus(app) is not null %}
{% for bit, status in file.getStatus(app) %}
<tr>