Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposed CKEDITOR.ui.balloonToolbar.reposition #2667

Merged
merged 10 commits into from
Dec 20, 2018
Merged

Exposed CKEDITOR.ui.balloonToolbar.reposition #2667

merged 10 commits into from
Dec 20, 2018

Conversation

engineering-this
Copy link
Contributor

What is the purpose of this pull request?

New Feature

Does your PR contain necessary tests?

All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

I've added method to reposition balloon toolbar.

Closes #1496

@Comandeer Comandeer self-requested a review December 12, 2018 10:19
@Comandeer Comandeer self-assigned this Dec 12, 2018
Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests are failing:

selection_065

Additionally I'm thinking about remaining the method to updatePosition. WDYT?


balloonToolbar.reposition( options );

assert.areSame( markerElement, spy.args[ 0 ][ 0 ] );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the element is the same, yet tests fail due to the fact that element's wrappers are different. equals should be used here.

panel.attach( square );

CKEDITOR.tools.array.forEach( CKEDITOR.document.find( '.control' ).toArray(), function( input ) {
input.on( 'change', function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In newer browsers we could use input instead of change, to dynamically move square when interacting with slider.

this.attach( this._pointedElement, {
focusElement: false
} );
this.reposition( { focusElement: false } );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You pass parameter to the reposition method here, yet it does not accept any parameters. IMO it should, as it should pass options to the attach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if reposition should really accept options, as balloonToolbar.attach doesn't.

There are two options
show and focusElement, one allows to initially hide balloonToolbarView(balloonPanel) and other to focus some element. I don't really see why this should be done by repositioning method, as it is supposed only to adjust toolbar position when target element moves.

balloonToolbar.reposition( options );

assert.areSame( markerElement, spy.args[ 0 ][ 0 ] );
assert.areSame( options, spy.args[ 0 ][ 1 ] );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This statement also can fail as ATM reposition does not support options.

@engineering-this engineering-this self-assigned this Dec 18, 2018
Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants