Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge 523045f into a44c67c
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Jun 29, 2018
2 parents a44c67c + 523045f commit d184e06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/panel/balloon/balloonpanelview.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export default class BalloonPanelView extends View {
fitInViewport: true
}, options );

const { top, left, name: position } = getOptimalPosition( positionOptions );
const { top, left, name: position } = BalloonPanelView._getOptimalPosition( positionOptions );

Object.assign( this, { top, left, position } );
}
Expand Down Expand Up @@ -415,6 +415,14 @@ BalloonPanelView.arrowHorizontalOffset = 25;
*/
BalloonPanelView.arrowVerticalOffset = 10;

/**
* Function used to calculate the optimal position for the balloon.
*
* @protected
* @member {Function} module:ui/panel/balloon/balloonpanelview~BalloonPanelView._getOptimalPosition
*/
BalloonPanelView._getOptimalPosition = getOptimalPosition;

/**
* A default set of positioning functions used by the balloon panel view
* when attaching using {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.
Expand Down
3 changes: 1 addition & 2 deletions tests/panel/balloon/balloonpanelview.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import ViewCollection from '../../../src/viewcollection';
import BalloonPanelView from '../../../src/panel/balloon/balloonpanelview';
import ButtonView from '../../../src/button/buttonview';
import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
import * as positionUtils from '@ckeditor/ckeditor5-utils/src/dom/position';

testUtils.createSinonSandbox();

Expand Down Expand Up @@ -173,7 +172,7 @@ describe( 'BalloonPanelView', () => {
} );

it( 'should use default options', () => {
const spy = testUtils.sinon.spy( positionUtils, 'getOptimalPosition' );
const spy = testUtils.sinon.spy( BalloonPanelView, '_getOptimalPosition' );

view.attachTo( { target } );

Expand Down

0 comments on commit d184e06

Please sign in to comment.