|
|
@@ -245,7 +245,7 @@ export default class WidgetToolbarRepository extends Plugin {
|
|
|
for ( const definition of this._toolbarDefinitions.values() ) {
|
|
|
const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
|
|
|
|
|
|
- if ( !this.isEnabled ) {
|
|
|
+ if ( !this.isEnabled || !relatedElement ) {
|
|
|
if ( this._isToolbarInBalloon( definition ) ) {
|
|
|
this._hideToolbar( definition );
|
|
|
}
|
|
|
@@ -253,10 +253,6 @@ export default class WidgetToolbarRepository extends Plugin {
|
|
|
if ( this._isToolbarVisible( definition ) ) {
|
|
|
this._hideToolbar( definition );
|
|
|
}
|
|
|
- } else if ( !relatedElement ) {
|
|
|
- if ( this._isToolbarInBalloon( definition ) ) {
|
|
|
- this._hideToolbar( definition );
|
|
|
- }
|
|
|
} else {
|
|
|
const relatedElementDepth = relatedElement.getAncestors().length;
|
|
|
|