Browse Source

Reduced number of visible fake panels by one.

Oskar Wróbel 6 years ago
parent
commit
a1bc5feb72
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/ckeditor5-ui/src/panel/balloon/contextualballoon.js

+ 3 - 1
packages/ckeditor5-ui/src/panel/balloon/contextualballoon.js

@@ -415,7 +415,7 @@ export default class ContextualBalloon extends Plugin {
 		const view = new FakePanelsView( this.editor.locale, this.view );
 		const view = new FakePanelsView( this.editor.locale, this.view );
 
 
 		view.bind( 'numberOfPanels' ).to( this, '_numberOfStacks', number => {
 		view.bind( 'numberOfPanels' ).to( this, '_numberOfStacks', number => {
-			return number < 2 ? 0 : Math.min( number, 3 );
+			return number < 2 ? 0 : Math.min( number - 1, 3 );
 		} );
 		} );
 
 
 		view.listenTo( this.view, 'change:top', () => view.updatePosition() );
 		view.listenTo( this.view, 'change:top', () => view.updatePosition() );
@@ -707,6 +707,8 @@ class FakePanelsView extends View {
 			} else {
 			} else {
 				this._removePanels( prev - next );
 				this._removePanels( prev - next );
 			}
 			}
+
+			this.updatePosition();
 		} );
 		} );
 	}
 	}