Commit c46e6e98 authored by tom's avatar tom

Return jqxhr object from ajax request

Not the context of the request
parent e83d6b94
...@@ -78,12 +78,10 @@ ...@@ -78,12 +78,10 @@
} }
delete args.data; delete args.data;
$.extend(args, {statusCode: statusCode}); $.extend(args, {statusCode: statusCode});
return this.each(function () {
var ajaxOptions = { var ajaxOptions = {
type: type, type: type,
url: $(this).slapos('host') + method, url: $(this).slapos('host') + method,
contentType: 'application/json', contentType: 'application/json',
//cache: false,
data: JSON.stringify(data), data: JSON.stringify(data),
datatype: 'json', datatype: 'json',
context: $(this), context: $(this),
...@@ -97,8 +95,7 @@ ...@@ -97,8 +95,7 @@
} }
}; };
$.extend(ajaxOptions, args); $.extend(ajaxOptions, args);
$.ajax(ajaxOptions); return $.ajax(ajaxOptions);
});
}, },
instanceList: function (args) { instanceList: function (args) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment