Skip to content

Commit

Permalink
Merge pull request #4265 from GeotrekCE/impr_annotation_category
Browse files Browse the repository at this point in the history
💫 [IMPR] Allow use Annotation Categories on annotations other than Points (refs #4032)
  • Loading branch information
Chatewgne authored Aug 13, 2024
2 parents b2aa31a + 393ec0f commit 9f59350
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 5 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down
13 changes: 6 additions & 7 deletions geotrek/common/static/common/js/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 9f59350

Please sign in to comment.