Commit 1e17befa authored by Marc Duez's avatar Marc Duez
Browse files

database.js :

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