mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Fixed logic for popping up inspector only with selection
This commit is contained in:
parent
f26bec23c9
commit
2e0a0e0243
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue