|
@@ -41,7 +41,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
it( 'should set default values', () => {
|
|
it( 'should set default values', () => {
|
|
|
expect( view.top ).to.equal( 0 );
|
|
expect( view.top ).to.equal( 0 );
|
|
|
expect( view.left ).to.equal( 0 );
|
|
expect( view.left ).to.equal( 0 );
|
|
|
- expect( view.position ).to.equal( 'arrow_se' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_ne' );
|
|
|
expect( view.isVisible ).to.equal( false );
|
|
expect( view.isVisible ).to.equal( false );
|
|
|
expect( view.withArrow ).to.equal( true );
|
|
expect( view.withArrow ).to.equal( true );
|
|
|
} );
|
|
} );
|
|
@@ -54,11 +54,11 @@ describe( 'BalloonPanelView', () => {
|
|
|
describe( 'DOM bindings', () => {
|
|
describe( 'DOM bindings', () => {
|
|
|
describe( 'arrow', () => {
|
|
describe( 'arrow', () => {
|
|
|
it( 'should react on view#position', () => {
|
|
it( 'should react on view#position', () => {
|
|
|
- expect( view.element.classList.contains( 'ck-balloon-panel_arrow_se' ) ).to.true;
|
|
|
|
|
|
|
+ expect( view.element.classList.contains( 'ck-balloon-panel_arrow_ne' ) ).to.true;
|
|
|
|
|
|
|
|
- view.position = 'arrow_sw';
|
|
|
|
|
|
|
+ view.position = 'arrow_nw';
|
|
|
|
|
|
|
|
- expect( view.element.classList.contains( 'ck-balloon-panel_arrow_sw' ) ).to.true;
|
|
|
|
|
|
|
+ expect( view.element.classList.contains( 'ck-balloon-panel_arrow_nw' ) ).to.true;
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should react on view#withArrow', () => {
|
|
it( 'should react on view#withArrow', () => {
|
|
@@ -221,7 +221,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_se' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_ne' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should put balloon on the `south east` side of the target element when target is on the top left side of the limiter', () => {
|
|
it( 'should put balloon on the `south east` side of the target element when target is on the top left side of the limiter', () => {
|
|
@@ -234,7 +234,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_se' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_ne' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should put balloon on the `south west` side of the target element when target is on the right side of the limiter', () => {
|
|
it( 'should put balloon on the `south west` side of the target element when target is on the right side of the limiter', () => {
|
|
@@ -247,7 +247,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_sw' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_nw' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should put balloon on the `north east` side of the target element when target is on the bottom of the limiter ', () => {
|
|
it( 'should put balloon on the `north east` side of the target element when target is on the bottom of the limiter ', () => {
|
|
@@ -260,7 +260,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_ne' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_se' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should put balloon on the `north west` side of the target element when target is on the bottom right of the limiter', () => {
|
|
it( 'should put balloon on the `north west` side of the target element when target is on the bottom right of the limiter', () => {
|
|
@@ -273,7 +273,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_nw' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_sw' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
// https://github.com/ckeditor/ckeditor5-ui-default/issues/126
|
|
// https://github.com/ckeditor/ckeditor5-ui-default/issues/126
|
|
@@ -354,7 +354,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_sw' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_nw' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should put balloon on the `south east` position when `south west` is limited', () => {
|
|
it( 'should put balloon on the `south east` position when `south west` is limited', () => {
|
|
@@ -374,7 +374,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_se' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_ne' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should put balloon on the `north east` position when `south east` is limited', () => {
|
|
it( 'should put balloon on the `north east` position when `south east` is limited', () => {
|
|
@@ -398,7 +398,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_ne' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_se' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should put balloon on the `south east` position when `north east` is limited', () => {
|
|
it( 'should put balloon on the `south east` position when `north east` is limited', () => {
|
|
@@ -418,7 +418,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
|
|
|
|
|
view.attachTo( { target, limiter } );
|
|
view.attachTo( { target, limiter } );
|
|
|
|
|
|
|
|
- expect( view.position ).to.equal( 'arrow_se' );
|
|
|
|
|
|
|
+ expect( view.position ).to.equal( 'arrow_ne' );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
@@ -662,7 +662,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.southEastArrowNorthEast( targetRect ) ).to.deep.equal( {
|
|
expect( positions.southEastArrowNorthEast( targetRect ) ).to.deep.equal( {
|
|
|
top: 215,
|
|
top: 215,
|
|
|
left: 120,
|
|
left: 120,
|
|
|
- name: 'arrow_se'
|
|
|
|
|
|
|
+ name: 'arrow_ne'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -670,7 +670,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.southWestArrowNorthEast( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.southWestArrowNorthEast( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 215,
|
|
top: 215,
|
|
|
left: 130,
|
|
left: 130,
|
|
|
- name: 'arrow_sw'
|
|
|
|
|
|
|
+ name: 'arrow_nw'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -678,7 +678,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.northEastArrowSouthWest( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.northEastArrowSouthWest( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 35,
|
|
top: 35,
|
|
|
left: 120,
|
|
left: 120,
|
|
|
- name: 'arrow_ne'
|
|
|
|
|
|
|
+ name: 'arrow_se'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -686,7 +686,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.northWestArrowSouthEast( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.northWestArrowSouthEast( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 35,
|
|
top: 35,
|
|
|
left: 130,
|
|
left: 130,
|
|
|
- name: 'arrow_nw'
|
|
|
|
|
|
|
+ name: 'arrow_sw'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -694,7 +694,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.southEastArrowNorth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.southEastArrowNorth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 215,
|
|
top: 215,
|
|
|
left: 175,
|
|
left: 175,
|
|
|
- name: 'arrow_s'
|
|
|
|
|
|
|
+ name: 'arrow_n'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -702,7 +702,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.northEastArrowSouth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.northEastArrowSouth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 35,
|
|
top: 35,
|
|
|
left: 175,
|
|
left: 175,
|
|
|
- name: 'arrow_n'
|
|
|
|
|
|
|
+ name: 'arrow_s'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -710,7 +710,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.northWestArrowSouth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.northWestArrowSouth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 35,
|
|
top: 35,
|
|
|
left: 75,
|
|
left: 75,
|
|
|
- name: 'arrow_n'
|
|
|
|
|
|
|
+ name: 'arrow_s'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -718,7 +718,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.southWestArrowNorth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.southWestArrowNorth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 215,
|
|
top: 215,
|
|
|
left: 75,
|
|
left: 75,
|
|
|
- name: 'arrow_s'
|
|
|
|
|
|
|
+ name: 'arrow_n'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -726,7 +726,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.southArrowNorth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.southArrowNorth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 215,
|
|
top: 215,
|
|
|
left: 125,
|
|
left: 125,
|
|
|
- name: 'arrow_s'
|
|
|
|
|
|
|
+ name: 'arrow_n'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -734,7 +734,7 @@ describe( 'BalloonPanelView', () => {
|
|
|
expect( positions.northArrowSouth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
expect( positions.northArrowSouth( targetRect, balloonRect ) ).to.deep.equal( {
|
|
|
top: 35,
|
|
top: 35,
|
|
|
left: 125,
|
|
left: 125,
|
|
|
- name: 'arrow_n'
|
|
|
|
|
|
|
+ name: 'arrow_s'
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|