Skip to content

Commit

Permalink
don't remove focus switching from editing a shape to drawing a new sh…
Browse files Browse the repository at this point in the history
…ape while editing an annotation
  • Loading branch information
rsinghal committed Aug 30, 2016
1 parent 5b0b7d8 commit 20a525d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions js/src/annotations/osd-region-draw-tool.js
Expand Up @@ -41,6 +41,8 @@
this.svgOverlay.show();
this.svgOverlay.enable();
this.render();
} else {
this.svgOverlay.checkToRemoveFocus();
}
},

Expand All @@ -49,6 +51,8 @@
this.osdViewer.setMouseNavEnabled(false);
this.svgOverlay.show();
this.svgOverlay.enable();
} else {
this.svgOverlay.checkToRemoveFocus();
}
},

Expand Down
12 changes: 8 additions & 4 deletions js/src/annotations/osd-svg-overlay.js
Expand Up @@ -185,10 +185,6 @@
_this.currentTool = _this.tools[i];
}
}
//if we are switching between editing and drawing, remove an old path
if (_this.inEditOrCreateMode && _this.path) {
_this.removeFocus();
}
}));

var _thisHandleDeleteShapeEvent = function(event,shape){
Expand Down Expand Up @@ -908,6 +904,14 @@
this.canvas.style.display = 'block';
},

checkToRemoveFocus: function() {
this.currentTool = '';
//if we are switching between editing and drawing, remove an old path
if (this.inEditOrCreateMode && this.path) {
this.removeFocus();
}
},

disable: function() {
this.disabled = true;
this.inEditOrCreateMode = false;
Expand Down

0 comments on commit 20a525d

Please sign in to comment.