ScoDoc/app/static/js/edit_partition_form.js

33 lines
727 B
JavaScript
Raw Permalink Normal View History

2020-09-26 16:19:37 +02:00
function _partition_set_attr(partition_id, attr_name, attr_value) {
$.post(
SCO_URL + "partition_set_attr",
{
partition_id: partition_id,
attr: attr_name,
value: attr_value,
},
function (result) {
sco_message(result);
}
);
return;
2021-06-21 18:46:35 +02:00
}
2020-09-26 16:19:37 +02:00
// Met à jour bul_show_rank lorsque checkbox modifiees:
function update_rk(e) {
var partition_id = $(e).attr("data-partition_id");
var v;
if (e.checked) v = "1";
else v = "0";
_partition_set_attr(partition_id, "bul_show_rank", v);
2020-09-26 16:19:37 +02:00
}
function update_show_in_list(e) {
var partition_id = $(e).attr("data-partition_id");
var v;
if (e.checked) v = "1";
else v = "0";
2021-06-21 18:46:35 +02:00
_partition_set_attr(partition_id, "show_in_lists", v);
2021-06-21 18:46:35 +02:00
}