jquery: fix obsolete uses of success (#3548).

This commit is contained in:
evazion
2018-04-26 23:53:49 -05:00
parent f7748a2ed7
commit a49cb1c105
5 changed files with 11 additions and 14 deletions

View File

@@ -101,14 +101,11 @@
}
Danbooru.Upload.fetch_source_data = function(url, referer_url) {
var xhr = $.getJSON("/source.json", { url: url, ref: referer_url });
xhr.success(Danbooru.Upload.fill_source_info);
xhr.fail(function(data) {
$("#source-info span#loading-data").html("Error: " + data.responseJSON["message"])
});
return xhr;
return $.getJSON("/source.json", { url: url, ref: referer_url })
.then(Danbooru.Upload.fill_source_info)
.catch(function(data) {
$("#source-info span#loading-data").html("Error: " + data.responseJSON["message"])
});
}
Danbooru.Upload.fill_source_info = function(data) {