Commit 01b4a0a3 authored by Marc Duez's avatar Marc Duez
Browse files

database.js :

- debug file upload
- database error display first (better z-index)
parent 4599cd5c
......@@ -540,7 +540,7 @@ max-height: calc(~"100%" - @margin)
#popup-container{
z-index:3;
z-index:5;
border:solid;
position: fixed;
top: 250px;
......
......@@ -168,6 +168,8 @@
<a class="buttonSelector" onclick="db.call('patient_list');">patient list</a>
<a class="buttonSelector" onclick="db.call('standard_list');">standard list</a>
<a class="buttonSelector" onclick="db.call('config_list');">config list</a>
<div id="upload_list"></div>
</div>
</div>
......
......@@ -75,7 +75,9 @@ Database.prototype = {
//submit formulaire avec fichier
if ( document.getElementById('upload_form') ){
$('#upload_form')
.ajaxForm({
.on('submit', function (e) {
e.preventDefault();
$.ajax({
type: "POST",
cache: false,
crossDomain: true,
......@@ -118,7 +120,8 @@ Database.prototype = {
success: function (result) {
var res = jQuery.parseJSON(result);
if (res.success == "true") {
$('#upload_percent_' + upload_n)
.html("upload success");
} else {
popupMsg(res.error);
}
......@@ -131,8 +134,10 @@ Database.prototype = {
}
}
});
});
}
},
error: function (request, status, error) {
if (status === "timeout") {
popupMsg("timeout");
......@@ -140,6 +145,7 @@ Database.prototype = {
popupMsg(request.responseText);
}
}
});
},
......
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