summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorRobert Zorko <robertz@gurucue.com>2015-10-16 11:26:32 +0200
committerRobert Zorko <robertz@gurucue.com>2015-10-16 11:26:32 +0200
commit3fa8787e93ddb751c92412662db578aad841f120 (patch)
treeb611daecfad1853815f1f8355120dfc7bce3445c /js
parente5f4844fa6306aab17c15595c2da411d879ffa48 (diff)
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
Diffstat (limited to 'js')
-rw-r--r--js/codeq/settings.js6
1 files changed, 5 insertions, 1 deletions
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(){