@@ -55,8 +55,8 @@ var AnnotationSelector = Panel.extend({
5555 this . listenTo ( this . collection , 'change:highlight' , this . _changeAnnotationHighlight ) ;
5656 this . listenTo ( eventStream , 'g:event.job_status' , _ . debounce ( this . _onJobUpdate , 500 ) ) ;
5757 this . listenTo ( eventStream , 'g:eventStream.start' , this . _refreshAnnotations ) ;
58- this . listenTo ( eventStream , 'g:event.large_image_annotation.create' , this . _refreshAnnotations ) ;
59- this . listenTo ( eventStream , 'g:event.large_image_annotation.remove' , this . _refreshAnnotations ) ;
58+ this . listenTo ( eventStream , 'g:event.large_image_annotation.create' , this . _refreshAnnotationsCheck ) ;
59+ this . listenTo ( eventStream , 'g:event.large_image_annotation.remove' , this . _refreshAnnotationsCheck ) ;
6060 this . listenTo ( this . collection , 'h:revert:annotation' , this . _refreshAnnotations ) ;
6161 this . listenTo ( this . collection , 'change:annotation change:groups' , this . _saveAnnotation ) ;
6262 this . listenTo ( girderEvents , 'g:login' , ( ) => {
@@ -279,6 +279,16 @@ var AnnotationSelector = Panel.extend({
279279 }
280280 } ,
281281
282+ _refreshAnnotationsCheck ( evt ) {
283+ if ( ! evt . data || ! evt . data . itemId ) {
284+ return ;
285+ }
286+ if ( ! this . parentItem || ! this . parentItem . id || evt . data . itemId !== this . parentItem . id ) {
287+ return ;
288+ }
289+ this . _refreshAnnotations ( ) ;
290+ } ,
291+
282292 _refreshAnnotations ( ) {
283293 if ( this . _norefresh ) {
284294 delete this . _norefresh ;
0 commit comments