From 706d1c476ed301497888fa079ac367c5ec0dbba8 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Fri, 1 Jul 2016 16:16:02 +0200
Subject: [PATCH] [ui] Fix redirection when doing error processing

---
 beat/web/ui/static/ui/js/widgets.js | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/beat/web/ui/static/ui/js/widgets.js b/beat/web/ui/static/ui/js/widgets.js
index 201f670ae..0a340e442 100644
--- a/beat/web/ui/static/ui/js/widgets.js
+++ b/beat/web/ui/static/ui/js/widgets.js
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
  * Contact: beat.support@idiap.ch
- * 
+ *
  * This file is part of the beat.web module of the BEAT platform.
- * 
+ *
  * Commercial License Usage
  * Licensees holding valid commercial BEAT licenses may use this file in
  * accordance with the terms contained in a written agreement between you
  * and Idiap. For further information contact tto@idiap.ch
- * 
+ *
  * Alternatively, this file may be used under the terms of the GNU Affero
  * Public License version 3 as published by the Free Software and appearing
  * in the file LICENSE.AGPL included in the packaging of this file.
  * The BEAT platform is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.
- * 
+ *
  * You should have received a copy of the GNU Affero Public License along
  * with the BEAT platform. If not, see http://www.gnu.org/licenses/.
 */
@@ -131,8 +131,8 @@ function process_error(data, status_text, redirect) {
       type: BootstrapDialog.TYPE_DANGER,
       title: 'Error during submission' + ' - ' + data.statusText + ' (' + data.status + ')',
       message: div,
-      onhidden: function() {
-        if (redirect !== undefined) window.location = redirect;
+      callback: function(result) {
+        if (redirect !== undefined) window.location.href = redirect;
       }
     });
   }
@@ -142,8 +142,8 @@ function process_error(data, status_text, redirect) {
       message: 'An empty response was received by your browser, for a request you sent. This normally indicates it cannot establish a connection with the web service. In the hopes it is a temporary issue, you may re-submit your request again at a later moment. Otherwise, please contact the system administrators.',
       type: BootstrapDialog.TYPE_DANGER,
       title: 'Empty response',
-      onhidden: function() {
-        if (redirect !== undefined) window.location = redirect;
+      callback: function(result) {
+        if (redirect !== undefined) window.location.href = redirect;
       }
     });
   }
@@ -152,8 +152,8 @@ function process_error(data, status_text, redirect) {
       message: data.responseJSON,
       type: BootstrapDialog.TYPE_DANGER,
       title: data.statusText + ' (' + data.status + ')',
-      onhidden: function() {
-        if (redirect !== undefined) window.location = redirect;
+      callback: function(result) {
+        if (redirect !== undefined) window.location.href = redirect;
       }
     });
   }
-- 
GitLab