Commit ab7dae4c authored by Marc Duez's avatar Marc Duez

database.js: waiting screen for some operation

parent e627eba4
......@@ -1293,3 +1293,17 @@ table.log {
table.log textarea {
width: 100%;
}
#waiting_screen {
background: rgba(0, 0, 0, 0.5);
position: absolute;
width: 100%;
height: 100%;
z-index: 1000;
display: none;
}
#waiting_mes {
text-align: center;
font-size: 200%;
margin-top: 200px;
background: #FFF;
}
......@@ -1293,3 +1293,17 @@ table.log {
table.log textarea {
width: 100%;
}
#waiting_screen {
background: rgba(0, 0, 0, 0.5);
position: absolute;
width: 100%;
height: 100%;
z-index: 1000;
display: none;
}
#waiting_mes {
text-align: center;
font-size: 200%;
margin-top: 200px;
background: #FFF;
}
......@@ -1474,3 +1474,19 @@ table.log textarea
{
width: 100%;
}
#waiting_screen{
background: rgba(0, 0, 0, 0.5);
position: absolute;
width: 100%;
height: 100%;
z-index: 1000;
display: none;
}
#waiting_mes{
text-align: center;
font-size: 200%;
margin-top: 200px;
background: #FFF;
}
\ No newline at end of file
......@@ -362,8 +362,8 @@
<div id="flash_container"></div>
<div id="log_container"></div>
<form id="form"></form>
<div id="waiting_screen"> <div id="waiting_mes"></div></div>
</body>
......
......@@ -458,16 +458,19 @@ Database.prototype = {
var new_location = url+arg
window.history.pushState('plop', 'plop', new_location);
this.wait("please wait : this operation can take a few minutes")
$.ajax({
type: "POST",
timeout: 15000,
timeout: 1200000,
crossDomain: true,
url: self.db_address + "default/get_custom_data" + arg,
xhrFields: {withCredentials: true},
success: function (result) {
self.resume()
self.display_result(result, "", args);
},
error: function (request, status, error) {
self.resume()
if (status === "timeout") {
myConsole.flash(myConsole.msg.database_timeout + " - unable to access patient data", 1)
} else {
......@@ -654,8 +657,18 @@ Database.prototype = {
}
});
}
}
},
wait: function(text){
document.getElementById("waiting_screen").style.display = "block";
document.getElementById("waiting_mes").innerHTML= text;
},
resume: function(){
document.getElementById("waiting_screen").style.display = "none";
document.getElementById("waiting_mes").innerHTML= "";
}
}
/*crée une liste de suggestion dynamique autour d'un input text*/
......
Markdown is supported
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