forked from DGNum/gestioCOF
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:
parent
5d8427e601
commit
bf0e345301
1 changed files with 5 additions and 4 deletions
|
@ -182,7 +182,7 @@ $(document).ready(function() {
|
||||||
settings = {}
|
settings = {}
|
||||||
|
|
||||||
function resetSettings() {
|
function resetSettings() {
|
||||||
$.ajax({
|
return $.ajax({
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
url : "{% url 'kfet.kpsul.get_settings' %}",
|
url : "{% url 'kfet.kpsul.get_settings' %}",
|
||||||
method : "POST",
|
method : "POST",
|
||||||
|
@ -1431,9 +1431,10 @@ $(document).ready(function() {
|
||||||
resetArticles();
|
resetArticles();
|
||||||
resetPreviousOp();
|
resetPreviousOp();
|
||||||
khistory.reset();
|
khistory.reset();
|
||||||
resetSettings();
|
resetSettings().done(function (){
|
||||||
getArticles();
|
getArticles();
|
||||||
getHistory();
|
getHistory();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetSelectable() {
|
function resetSelectable() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue