Commit 959e9181 authored by lucas64500's avatar lucas64500

Corrections

parent 7622c835
......@@ -42,8 +42,7 @@ function activerBoutons(){
case "pparametres-ruche":
$("#form-params-hive").find(".bouton").click(submitParamsHive);
$("#goToSeuils").on("submit",function(e) {
$("#goToSeuils").on("click",function(e) {
e.preventDefault();goToHiveSeuils();});
break;
......
......@@ -197,47 +197,42 @@ function goToHiveParameters() {
goToDataHive(true);
})
}
else {
$("#form-params-hive").find(".bouton").click(function(e){
$("#form-params-hive").submit();
});
$("#form-params-hive").submit(function(e){
//console.log("début modif");
e.preventDefault();
var donnees = $(this).serialize();
console.log(donnees);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
charge();
$.ajax({
type: 'PATCH',
url: url+'pshive/'+donneesRuches.hivegroups[idHiveGroup].hives[idHive].id_hive + '/update',
xhrFields: {
withCredentials: true
},
data: donnees,
success: function(data) {
console.log(data);
//customer = data;
updateLocalHive(data);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
/* go back to details */
finCharge();
goToDataHive(true);
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
});
}
//organiserRuches(listHives.ruches.length);
//masquerBd();
//console.log('goToHiveParameters : end');
}
function submitParamsHive(){
console.log("début modif");
var donnees = $(this).serialize();
console.log(donnees);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
charge();
$.ajax({
type: 'PATCH',
url: url+'pshive/'+donneesRuches.hivegroups[idHiveGroup].hives[idHive].id_hive + '/update',
xhrFields: {
withCredentials: true
},
data: donnees,
success: function(data) {
console.log(data);
//customer = data;
updateLocalHive(data);
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
/* go back to details */
finCharge();
goToDataHive(true);
//console.log("fin modif");
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
/**
* display the parameters for the floor and ceiling value (launching the notifications)
*/
......
......@@ -269,9 +269,8 @@
</form>
</script>
<script type="text/html" id="tpl-params-ruche">
<form class="formulaire" id="goToSeuils" type="custom">
<input type="submit" class="histo_important" value="Notifications" />
</form>
<div id="goToSeuils" class="bouton2" style="text-align:center;clear:none;" >Notifications</div>
<form class="formulaire" id="form-params-hive" >
<div id="apibundle_pshive">
<!--<div>
......
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