File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,7 @@ var AnnotationSelector = Panel.extend({
287287 // remove annotations that are displayed but have been deleted
288288 Object . keys ( models ) . forEach ( ( id ) => {
289289 if ( ! this . collection . get ( id ) && models [ id ] . get ( 'displayed' ) ) {
290+ this . _deselectAnnotationElements ( models [ id ] ) ;
290291 this . viewer . removeAnnotation ( models [ id ] ) ;
291292 }
292293 } ) ;
Original file line number Diff line number Diff line change @@ -324,6 +324,7 @@ var ImageView = View.extend({
324324 } ,
325325 openImage ( id ) {
326326 /* eslint-disable backbone/no-silent */
327+ this . _resetSelection ( ) ;
327328 this . model . clear ( { silent : true } ) ;
328329 delete this . model . parent ;
329330 if ( id ) {
@@ -1487,10 +1488,10 @@ var ImageView = View.extend({
14871488 } ,
14881489
14891490 _resetSelection ( ) {
1490- if ( this . viewerWidget . _highlightAnnotation ) {
1491+ if ( this . viewerWidget && this . viewerWidget . _highlightAnnotation ) {
14911492 this . viewerWidget . highlightAnnotation ( ) ;
14921493 }
1493- if ( this . selectedElements . length ) {
1494+ if ( this . selectedElements && this . selectedElements . length ) {
14941495 this . selectedElements . reset ( ) ;
14951496 }
14961497 } ,
You can’t perform that action at this time.
0 commit comments