From 0bf4bf3c068dfc5c0e64b5950de89d0c4bab2f2a Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 18 Nov 2016 15:07:33 +0800 Subject: webui: configs.js: Fix two bugs * Fix the wrong "action=reset" in "setServerConfigs()" * Add the missing "return" in the jQuery AJAX chain --- fg21sim/webui/static/js/configs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fg21sim/webui/static/js') diff --git a/fg21sim/webui/static/js/configs.js b/fg21sim/webui/static/js/configs.js index 67fe032..e1e9a93 100644 --- a/fg21sim/webui/static/js/configs.js +++ b/fg21sim/webui/static/js/configs.js @@ -386,7 +386,7 @@ var resetConfigs = function (url) { */ var setServerConfigs = function (url, data) { data = typeof data !== "undefined" ? data : {}; - return $.postJSON(url, {action: "reset", data: data}, + return $.postJSON(url, {action: "set", data: data}, function (response) { setFormConfigs({}, response.errors); }) @@ -594,7 +594,7 @@ $(document).ready(function () { var data = {}; data[name] = value; setServerConfigs(ajax_url, data) - .then(function () { validateServerConfigs(ajax_url); }) + .then(function () { return validateServerConfigs(ajax_url); }) .done(function () { updateFormConfigStatus(); }); }); }); -- cgit v1.2.2