From 7e09e4109385c4e41374c727dd0a08bb0e28122f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 24 Oct 2015 22:59:38 +0200 Subject: [PATCH] Manage no database list and prevent multiple call to modal('show') as the stacked fix doesn't work with such usage. review15791002 --- src/session.js | 115 ++++++++++++++++++++++++++++++------------------- 1 file changed, 70 insertions(+), 45 deletions(-) diff --git a/src/session.js b/src/session.js index 158894ad5b..5b656f9b76 100644 --- a/src/session.js +++ b/src/session.js @@ -16,6 +16,7 @@ }, do_login: function(login, password) { var dfd = jQuery.Deferred(); + var timeoutID = Sao.common.processing.show(); var args = { 'method': 'common.db.login', 'params': [login, password] @@ -25,7 +26,10 @@ 'data': JSON.stringify(args), 'dataType': 'json', 'url': '/' + this.database, - 'type': 'post' + 'type': 'post', + 'complete': [function() { + Sao.common.processing.hide(timeoutID); + }] }); var ajax_success = function(data) { @@ -87,7 +91,11 @@ dialog.database_select = jQuery('', { + 'class': 'form-control', + 'id': 'login-database' + }).hide(); dialog.login_input = jQuery('', { 'class': 'form-control', 'id': 'login-login', @@ -102,28 +110,29 @@ dialog.body.append(jQuery('
', { 'class': 'form-group' }).append(jQuery('