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

34 lines
867 B
JavaScript
Raw Normal View History

2020-09-26 16:19:37 +02:00
// Edition tags sur modules
$(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(),
}).fail(function(jqXHR, textStatus, errorThrown) {
alert("erreur: tag non enregistré");
});
},
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
// version readonly
readOnlyTags($(".module_tag_editor_ro"));
2020-09-26 16:19:37 +02: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
});