2020-09-26 16:19:37 +02:00
|
|
|
// Edition tags sur modules
|
|
|
|
|
2023-11-17 13:53:17 +01:00
|
|
|
$(function () {
|
|
|
|
$(".module_tag_editor").tagEditor({
|
|
|
|
initialTags: "",
|
|
|
|
placeholder: "Tags du module ...",
|
|
|
|
forceLowercase: false,
|
|
|
|
onChange: function (field, editor, tags) {
|
|
|
|
$.post("module_tag_set", {
|
|
|
|
module_id: field.data("module_id"),
|
|
|
|
taglist: tags.join(),
|
2024-01-25 22:40:10 +01:00
|
|
|
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
|
alert("erreur: tag non enregistré");
|
2023-11-17 13:53:17 +01:00
|
|
|
});
|
|
|
|
},
|
|
|
|
autocomplete: {
|
|
|
|
delay: 200, // ms before suggest
|
|
|
|
position: { collision: "flip" }, // automatic menu position up/down
|
|
|
|
source: "module_tag_search",
|
|
|
|
},
|
|
|
|
});
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2023-11-17 13:53:17 +01:00
|
|
|
// version readonly
|
|
|
|
readOnlyTags($(".module_tag_editor_ro"));
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2023-11-17 13:53:17 +01:00
|
|
|
$(".sco_tag_checkbox").click(function () {
|
|
|
|
if ($(this).is(":checked")) {
|
|
|
|
$(".sco_tag_edit").show();
|
|
|
|
} else {
|
|
|
|
$(".sco_tag_edit").hide();
|
|
|
|
}
|
|
|
|
});
|
2020-09-26 16:19:37 +02:00
|
|
|
});
|