Only store values of the fields

pull/83/head
Sheng 5 years ago
parent 013c925ec4
commit b3c2094cd2

@ -649,9 +649,10 @@ jQuery(function($){
// use data from the arguments // use data from the arguments
var form = document.querySelector(form_id), var form = document.querySelector(form_id),
url = data.url || form.action, url = data.url || form.action,
_xsrf = form.querySelector('input[name="_xsrf"]'); _xsrf = form.querySelector('input[name="_xsrf"]'),
data_wrapped = wrap_object(data);
var result = validate_form_data(wrap_object(data)); var result = validate_form_data(data_wrapped);
if (!result.valid) { if (!result.valid) {
console.log(result.msg); console.log(result.msg);
return; return;
@ -662,12 +663,7 @@ jQuery(function($){
data._origin = event_origin; data._origin = event_origin;
} }
for (var datum in data) { store_items(fields, data_wrapped);
var value = data[datum];
if (value){
window.localStorage.setItem(datum, value);
}
}
restore_items(fields); restore_items(fields);
$.ajax({ $.ajax({

Loading…
Cancel
Save