diff --git a/docs/changelog.rst b/docs/changelog.rst index 2ab286e3ba..e5ec377961 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,13 +5,17 @@ CHANGELOG 2.109.0+dev (XXXX-XX-XX) ---------------------------- +**Improvements** + +- Allow use of Annotation Categories on annotations other than Points (#4032)" + 2.109.0 (2024-08-08) ---------------------------- **New features** -- Add Annotation Categories to improve annotations on HD Views(refs #4032) +- Add Annotation Categories to improve annotations on HD Views (#4032) **Improvements** diff --git a/geotrek/common/static/common/js/annotations.js b/geotrek/common/static/common/js/annotations.js index 71c5041e46..f8c889ab04 100644 --- a/geotrek/common/static/common/js/annotations.js +++ b/geotrek/common/static/common/js/annotations.js @@ -248,19 +248,18 @@ function initAnnotationsWidget(map) { entry.find('#label_input').on('blur', () => update_edited_label(entry)); entry.find('#label_input').on('keydown', (key) => update_edited_label_on_enter(entry, key)); - if (annotation.type() === 'point') { - var category_selector = $('#id_annotation_category').clone(); - category_selector.attr('for-annotation', id); - category_selector.on("change", update_annotation_category_event) - entry.find('.entry-validate').before(category_selector); - } + var category_selector = $('#id_annotation_category').clone(); + category_selector.attr('for-annotation', id); + category_selector.on("change", update_annotation_category_event) + entry.find('.entry-validate').before(category_selector); entry.find('.entry-name').text(annotation.name()); + if (query.editing == id) { entry.find('.entry-adjust').hide(); entry.find('.entry-validate').show(); } $('#annotationlist').append(entry); - if (annotation.type() === 'point' & $("#div_id_annotations_categories textarea").val() !== "") { + if ($("#div_id_annotations_categories textarea").val() !== "") { var annotations_categories = JSON.parse($("#div_id_annotations_categories textarea").val()); previous_category = annotations_categories[id] if (typeof previous_category !== 'undefined') {