From 61b6a4275dfe6e3dc8b5aeaf45cae34bf6f9d9dc Mon Sep 17 00:00:00 2001 From: David Manthey Date: Wed, 29 Jun 2022 11:26:41 -0400 Subject: [PATCH] Fix highlighting the active annotation. --- histomicsui/web_client/panels/AnnotationSelector.js | 2 +- histomicsui/web_client/views/body/ImageView.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/histomicsui/web_client/panels/AnnotationSelector.js b/histomicsui/web_client/panels/AnnotationSelector.js index 9ba35c42..7ab426e8 100644 --- a/histomicsui/web_client/panels/AnnotationSelector.js +++ b/histomicsui/web_client/panels/AnnotationSelector.js @@ -329,7 +329,7 @@ var AnnotationSelector = Panel.extend({ } model.set('displayed', true); - if (numElements > MAX_ELEMENTS_LIST_LENGTH) { + if (numElements > MAX_ELEMENTS_LIST_LENGTH || model._pageElements) { events.trigger('g:alert', { text: 'This annotation has too many elements to be edited.', type: 'warning', diff --git a/histomicsui/web_client/views/body/ImageView.js b/histomicsui/web_client/views/body/ImageView.js index 28538b5f..d37cc0d7 100644 --- a/histomicsui/web_client/views/body/ImageView.js +++ b/histomicsui/web_client/views/body/ImageView.js @@ -1058,8 +1058,10 @@ var ImageView = View.extend({ return; } this.activeAnnotation = model; + this.annotationSelector.$('.h-annotation').removeClass('h-active-annotation'); this._removeDrawWidget(); if (model) { + this.annotationSelector.$('.h-annotation[data-id="' + model.id + '"]').addClass('h-active-annotation'); this.drawWidget = new DrawWidget({ parentView: this, image: this.model,