Skip to content

Commit

Permalink
Merge pull request #192 from DigitalSlideArchive/active-annotation-hi…
Browse files Browse the repository at this point in the history
…ghlight

Fix highlighting the active annotation.
  • Loading branch information
manthey authored Jun 29, 2022
2 parents 40338a5 + 61b6a42 commit 053f777
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 053f777

Please sign in to comment.