Commit ee6eef54 authored by wilhelmhb's avatar wilhelmhb

suppression d'une note custom

parent 142fb028
......@@ -142,7 +142,7 @@ function deleteCustomNoteForHive(idCustomNote,idx) {
},
success: function(data) {
console.log("C'est RAS : " + data);
supprimerNote(idx);
supprimerNote(idx);
deleteCustomNoteToHiveSuccess();
},
error: function (xhr, ajaxOptions, thrownError) {
......@@ -156,24 +156,29 @@ function deleteCustomNoteForHive(idCustomNote,idx) {
function deleteCustomNote(idCustomNote) {
charge();
$.ajax({
type: 'DELETE',
url: url+'pscustomnote/' + idCustomNote,
xhrFields: {
withCredentials: true
},
success: function(data) {
console.log("C'est RAS : " + data);
ajouterNote();
$("#dlcn"+idCustomNote).remove();
$("#"+idCustomNote).remove();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
type: 'DELETE',
url: url+'pscustomnote/' + idCustomNote,
xhrFields: {
withCredentials: true
},
success: function(data) {
//console.log("C'est RAS : " + data);
//ajouterNote();
finCharge();
for(var i = 0 ; i < customNotesCreatedByUser.length ; i++) {
if(customNotesCreatedByUser[i].id == idCustomNote) {
customNotesCreatedByUser.splice(i, 1);
}
}
$("#dlcn"+idCustomNote).remove();
$("#"+idCustomNote).remove();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
......
......@@ -108,18 +108,18 @@ function afficherNotes(data, indexHive){
};
var template = $(templates).filter('#tpl-historique').html();
console.log(historique);
console.log(template);
//console.log(historique);
//console.log(template);
var h = Mustache.render(template, historique);
console.log(h);
//console.log(h);
document.getElementById("content-historique").innerHTML = h;
transition(_("phistorique"), "slide");
if(indexHive != null) {
idHive = indexHive;
}
console.log(idHive);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive].name);
//console.log(idHive);
//console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive].name);
if(idHive!=-1)$("#sous_titre_histo").children("h1").html(donneesRuches.hivegroups[idHiveGroup].hives[idHive].name);
else $("#sous_titre_histo").children("h1").html("Toutes les ruches");
......
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