Fixed logic for popping up inspector only with selection

This commit is contained in:
Trevor Parscal 2011-12-09 02:00:45 +00:00
parent f26bec23c9
commit 2e0a0e0243

View file

@ -23,10 +23,13 @@ es.AnnotationButtonTool = function( toolbar, name, data ) {
es.AnnotationButtonTool.prototype.onClick = function() {
var surfaceView = this.toolbar.getSurfaceView();
if ( this.inspector ) {
if ( !this.active && surfaceView.getModel().getSelection().getLength() ) {
if ( surfaceView.getModel().getSelection().getLength() ) {
this.toolbar.getSurfaceView().getContextView().openInspector( this.inspector );
} else {
if ( !this.active ) {
surfaceView.annotate( 'set', this.annotation );
}
this.toolbar.getSurfaceView().getContextView().openInspector( this.inspector );
}
} else {
surfaceView.annotate( this.active ? 'clear' : 'set', this.annotation );
}