From 3fa8787e93ddb751c92412662db578aad841f120 Mon Sep 17 00:00:00 2001 From: Robert Zorko Date: Fri, 16 Oct 2015 11:26:32 +0200 Subject: added an error msg ot the settings screen if something goes wrong and moved the redirect to only happen if the update request is successful. Also tested validation - the auto validation works, but the regex might need tweaking --- js/codeq/settings.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/codeq/settings.js b/js/codeq/settings.js index 8207c3f..5b57c49 100644 --- a/js/codeq/settings.js +++ b/js/codeq/settings.js @@ -22,9 +22,13 @@ if (data.code !== 0) { throw new Error('Updating settings failed, code: ' + data.code + ', message: ' + data.message); } + history.back(); + }) + .fail(function(reason){ + codeq.log.error('Settings update failed: ' + reason); + alert('Settings update failed: ' + reason); }) .done(); - history.back(); e.preventDefault(); }); jqSettCancelBtn.on("click",function(){ -- cgit v1.2.1