Merge branch 'Aufinal/fix_history' into 'master'

Fix asynchronous calls with resetSettings

See merge request !229
This commit is contained in:
Aurélien Delobelle 2017-05-15 23:43:28 +02:00
commit 95a8b484e0

View file

@ -182,7 +182,7 @@ $(document).ready(function() {
settings = {}
function resetSettings() {
$.ajax({
return $.ajax({
dataType: "json",
url : "{% url 'kfet.kpsul.get_settings' %}",
method : "POST",
@ -191,7 +191,6 @@ $(document).ready(function() {
settings['addcost_for'] = data['addcost_for'];
settings['addcost_amount'] = parseFloat(data['addcost_amount']);
settings['subvention_cof'] = parseFloat(data['subvention_cof']);
displayAddcost();
});
}
@ -1431,9 +1430,11 @@ $(document).ready(function() {
resetArticles();
resetPreviousOp();
khistory.reset();
resetSettings();
getArticles();
getHistory();
resetSettings().done(function (){
getArticles();
getHistory();
displayAddcost();
});
}
function resetSelectable() {