Skip to content

Commit

Permalink
Fix highlighting the active annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jun 29, 2022
1 parent 40338a5 commit 61b6a42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion histomicsui/web_client/panels/AnnotationSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions histomicsui/web_client/views/body/ImageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 61b6a42

Please sign in to comment.