Commit 390187bc authored by Romain Courteaud's avatar Romain Courteaud

slapos_parameter_editor: coding style

parent 675cdf27
Pipeline #34330 passed with stage
in 0 seconds
...@@ -17,15 +17,12 @@ ...@@ -17,15 +17,12 @@
}; };
} }
} }
return new RSVP.Queue() return new RSVP.Queue(jIO.util.ajax({
.push(function () { url: url,
return jIO.util.ajax({ headers: headers
url: url, }))
headers: headers .push(function (evt) {
}) return evt.target.responseText;
.then(function (evt) {
return evt.target.responseText;
});
}); });
} }
...@@ -42,10 +39,7 @@ ...@@ -42,10 +39,7 @@
} }
return getJSON(meta_schema_url) return getJSON(meta_schema_url)
.push(function (meta_schema) { .push(function (meta_schema) {
return new RSVP.Queue() return new RSVP.Queue($RefParser.dereference(url))
.push(function () {
return $RefParser.dereference(url);
})
.push(function (schema) { .push(function (schema) {
var validator = new Validator(JSON.parse(meta_schema), '7'); var validator = new Validator(JSON.parse(meta_schema), '7');
if (!validator.validate(schema)) { if (!validator.validate(schema)) {
...@@ -58,11 +52,9 @@ ...@@ -58,11 +52,9 @@
.declareMethod("loadSoftwareJSON", function (url) { .declareMethod("loadSoftwareJSON", function (url) {
return getJSON(url) return getJSON(url)
.push(function (software_cfg_json) { .push(function (software_cfg_json) {
return new RSVP.Queue() return new RSVP.Queue($RefParser
.push(function () { .dereference("slapos_load_software_schema.json")
return $RefParser )
.dereference("slapos_load_software_schema.json");
})
.push(function (software_schema) { .push(function (software_schema) {
var software_json = JSON.parse(software_cfg_json), var software_json = JSON.parse(software_cfg_json),
validator = new Validator(software_schema, '7'); validator = new Validator(software_schema, '7');
......
...@@ -462,7 +462,7 @@ ...@@ -462,7 +462,7 @@
show_form_button.classList.add("ui-icon-th-list"); show_form_button.classList.add("ui-icon-th-list");
return changed; return changed;
}) })
.fail(function (error) { .push(undefined, function (error) {
console.warn(error); console.warn(error);
console.log(error.stack); console.log(error.stack);
show_form_button.classList.remove("ui-icon-spinner"); show_form_button.classList.remove("ui-icon-spinner");
......
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