ScoDoc-PE/app/static/js/editPartitionForm.js

39 lines
825 B
JavaScript
Raw Normal View History

2020-09-26 16:19:37 +02:00
function _partition_set_attr(partition_id, attr_name, attr_value) {
2021-06-21 18:46:35 +02:00
$.post(SCO_URL + '/partition_set_attr',
{
'partition_id': partition_id,
'attr': attr_name,
'value': attr_value
},
function (result) {
sco_message(result);
});
2020-09-26 16:19:37 +02:00
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)
2021-06-21 18:46:35 +02:00
v = '1';
2020-09-26 16:19:37 +02:00
else
2021-06-21 18:46:35 +02:00
v = '0';
2020-09-26 16:19:37 +02:00
_partition_set_attr(partition_id, 'bul_show_rank', v);
}
function update_show_in_list(e) {
var partition_id = $(e).attr('data-partition_id');
var v;
if (e.checked)
2021-06-21 18:46:35 +02:00
v = '1';
2020-09-26 16:19:37 +02:00
else
2021-06-21 18:46:35 +02:00
v = '0';
2020-09-26 16:19:37 +02:00
_partition_set_attr(partition_id, 'show_in_lists', v);
2021-06-21 18:46:35 +02:00
}
2020-09-26 16:19:37 +02:00