From 82c908cfd9a8c7f1da4e6b0a2d85ec0b25e22b7b Mon Sep 17 00:00:00 2001
From: bbaer <bbaer@math.uzh.ch>
Date: Wed, 7 Feb 2018 01:32:08 +0100
Subject: [PATCH] higher prioritization of saves

---
 javascript/src/QfqForm.js | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/javascript/src/QfqForm.js b/javascript/src/QfqForm.js
index 7f2cb3093..bdb4a5d5a 100644
--- a/javascript/src/QfqForm.js
+++ b/javascript/src/QfqForm.js
@@ -955,6 +955,13 @@ var QfqNS = QfqNS || {};
                     alert.show();
                 }
 
+                // Skip other checks if external Save is called
+                if (this.goToAfterSave) {
+                    console.log("Called goToAfterSave = " + this.goToAfterSave);
+                    window.location = this.goToAfterSave;
+                    return;
+                }
+
                 // do we have to update the HTML Form?
                 if (data['form-update']) {
                     this.applyFormConfiguration(data['form-update']);
@@ -973,12 +980,6 @@ var QfqNS = QfqNS || {};
                     return;
                 }
 
-                if (this.goToAfterSave) {
-                    console.log("Called goToAfterSave = " + this.goToAfterSave);
-                    window.location = this.goToAfterSave;
-                    return;
-                }
-
                 break;
             case 'close':
                 if (!data.redirect || data.redirect === "no") {
-- 
GitLab