[FIX] web: resolve ajax.loadXML deferred at the proper time
There was a problem with the new `ajax.loadXML` implementation
introduced with 417a664f16
Indeed the following case was buggy:
```
ajax.loadXML('URL1', qweb);
ajax.loadXML().then(function () {
ajax.loadXML('URL2', qweb);
});
```
With this code, 'URL2' is scheduled to be loaded when 'URL1' is fully
loaded. The problem is that the deferred returned by the call to
`ajax.loadXML` without argument was resolved before the internal
`isLoading` variable was reset to `false`. So, the loading of 'URL2'
was indeed scheduled when 'URL1' was fully loaded but its loading
never started because the `ajax.loadXML` loading loop was still marked
as running (so it was not started again as it should have been).
This commit is contained in:
@@ -426,8 +426,8 @@ var loadXML = (function () {
|
||||
} else {
|
||||
// There is nothing to load anymore, so resolve the
|
||||
// "all the calls" deferred
|
||||
allLoadingsDef.resolve();
|
||||
isLoading = false;
|
||||
allLoadingsDef.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user