diff --git a/gemeinsamforschen/src/main/webapp/annotation/create-unstructured-annotation.jsp b/gemeinsamforschen/src/main/webapp/annotation/create-unstructured-annotation.jsp index e9c17485ec2f23c430340be0d031624336039493..0fb1a61af38ffc51773fc1d5e98aa296c3dc52ff 100644 --- a/gemeinsamforschen/src/main/webapp/annotation/create-unstructured-annotation.jsp +++ b/gemeinsamforschen/src/main/webapp/annotation/create-unstructured-annotation.jsp @@ -83,6 +83,7 @@ <div id="{{>nameLower}}" class="category-card not-added"> <p>{{>name}}</p> </div> + <a onClick="deleteCategory('{{>nameLower}}');"><i class="fa fa-trash" aria-hidden="true"></i></a> </li> {{/for}} </script> diff --git a/gemeinsamforschen/src/main/webapp/annotation/js/unstructuredAnnotation.js b/gemeinsamforschen/src/main/webapp/annotation/js/unstructuredAnnotation.js index 44fa1797156a19ee146b1bd6db2eb1146be95d52..84a772b968f4b70d6aca49a12482fd1b5fdebfbe 100644 --- a/gemeinsamforschen/src/main/webapp/annotation/js/unstructuredAnnotation.js +++ b/gemeinsamforschen/src/main/webapp/annotation/js/unstructuredAnnotation.js @@ -20,6 +20,7 @@ $(document).ready(function () { saveButtonHandler(); }); + /** * Context menu handler */ @@ -243,4 +244,19 @@ function buildAnnotationList(categories) { let tmpl = $.templates("#annotationTemplate"); let html = tmpl.render(data); $("#annotations").html(html); +} + +function deleteCategory(category) { + let categoryLI = $('#' + category); + let textArrays = categoryLI.data('array'); + for (let i = 0; i < textArrays.length; i++) { + quill.formatText(textArrays[i].start, textArrays[i].end - textArrays[i].start, 'background', '#FFF'); + } + categoryLI.data('array', []); + + $('.added-' + category).each(function () { + $(this).toggleClass('added-' + category + ' not-added'); + }); + + let test = category; } \ No newline at end of file diff --git a/gemeinsamforschen/src/main/webapp/project/js/tasks.js b/gemeinsamforschen/src/main/webapp/project/js/tasks.js index c686171ae256b0fb294efa32b38855e80a0b1af1..7f75c394cd518818cf01ce028bf9bffb05d84cad 100644 --- a/gemeinsamforschen/src/main/webapp/project/js/tasks.js +++ b/gemeinsamforschen/src/main/webapp/project/js/tasks.js @@ -58,7 +58,7 @@ function fitObjectInTmpl(object) { }; if (object.taskType !== "INFO") { - if (object.groupTask === true) { + if (object.groupTask !== 0) { result.taskType = "grouptask" } else { result.taskType = "usertask"