Skip to content

Commit 4640ada

Browse files
authored
Merge pull request #234 from DigitalSlideArchive/missing-default-group
Fix setting the default group in one spot.
2 parents 55e07b6 + 44a8c79 commit 4640ada

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

histomicsui/web_client/panels/DrawWidget.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ var DrawWidget = Panel.extend({
110110
elements: this.collection.models,
111111
groups: this._groups,
112112
style: this._style.id,
113+
defaultGroup: this.parentView._defaultGroup,
113114
highlighted: this._highlighted,
114115
name,
115116
opts: this._editOptions,
@@ -316,6 +317,7 @@ var DrawWidget = Panel.extend({
316317
this.$(`.h-element[data-id="${id}"]`).remove();
317318
this._skipRenderHTML = true;
318319
this.collection.remove(id, opts);
320+
this.newElementDisplayIdStart = +(this.$el.find('.h-element>span.h-element-label[display_id]').last().attr('display_id') || 0);
319321
},
320322

321323
/**

histomicsui/web_client/templates/panels/drawWidgetElement.pug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if elements.length
3333
}
3434
.h-element(data-id=element.id, class=classes)
3535
span.icon-cog.h-edit-element(title='Change style')
36-
span.h-element-label(title=label) #{label}
36+
span.h-element-label(title=label, display_id=displayId) #{label}
3737
span.icon-zoom-in.h-view-element(title='View annotation')
3838
span.icon-cancel.h-delete-element(title='Remove')
3939
if pixelmap

tests/web_client_specs/annotationSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ girderTest.promise.done(function () {
311311
return $('.h-elements-container .h-element').length === 2;
312312
}, 'point to be created');
313313
runs(function () {
314-
expect($('.h-elements-container .h-element:last .h-element-label').text()).toBe('default point 3');
314+
expect($('.h-elements-container .h-element:last .h-element-label').text()).toBe('default point 2');
315315
});
316316
checkAutoSave('drawn 1', 2, annotationInfo);
317317
});

0 commit comments

Comments
 (0)