Commit 90c92e3c authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Updated CODING.md.

QfqForm.js: Buttons should behave as described in CODING.md under UI.
parent e8edf67e
......@@ -92,6 +92,7 @@ Save Button
* Reset all validation states
* Form is submitted to server
* Success:
* Show message provided by server
* Current formelements and data will be reloaded.
* Process server reponse 'redirect':
* 'client': No redirect.
......
......@@ -420,26 +420,26 @@ var QfqNS = QfqNS || {};
switch (this.lastButtonPress) {
case 'save':
if (!data.redirect || data.redirect === "no") {
if (data.message) {
var alert = new n.Alert(data.message);
alert.timeout = 1500;
alert.show();
}
// do we have to update the HTML Form?
if (data['form-update']) {
this.applyElementConfiguration(data['form-update']);
}
return;
if (data.message) {
var alert = new n.Alert(data.message);
alert.timeout = 1500;
alert.show();
}
// do we have to update the HTML Form?
if (data['form-update']) {
this.applyElementConfiguration(data['form-update']);
}
if (data.redirect === "client") {
window.history.back();
if (data.redirect === "url" || data['redirect-url']) {
window.location = data['redirect-url'];
return;
}
break;
case 'close':
if (!data.redirect || data.redirect === "no" || data.redirect === "client") {
return;
}
if (data.redirect === "url" || data['redirect-url']) {
window.location = data['redirect-url'];
......@@ -448,7 +448,7 @@ var QfqNS = QfqNS || {};
break;
case 'new':
var target = this.getNewButtonTarget();
window.location = this.getNewButtonTarget();
window.location = target;
return;
default:
......
Supports Markdown
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