Fix asynchronous calls with resetSettings

The `resetSettings` function now returns the ajax object, allowing to
chain other calls to it, e.g. the `getHistory` function.
This commit is contained in:
Ludovic Stephan 2017-05-14 23:50:09 -03:00
parent 5d8427e601
commit bf0e345301

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",
@ -1431,9 +1431,10 @@ $(document).ready(function() {
resetArticles();
resetPreviousOp();
khistory.reset();
resetSettings();
getArticles();
getHistory();
resetSettings().done(function (){
getArticles();
getHistory();
});
}
function resetSelectable() {