-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Refresh balloon toolbar after change in the editor #1351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple things in tests.
On top of that I'd like this test to be merged into other test suite, for instance tests/plugins/balloontoolbar/view.js
. We don't want to have a separate test suite just for this one test case.
var tests = { | ||
setUp: function() { | ||
// In IE8 tests are run in very small window which breaks positioning assertions and tests fails (#1076). | ||
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is done by ignoreUnsupportedEnvironment
function that you call at the end of a file.
assert.ignore(); | ||
} | ||
if ( parentFrame ) { | ||
parentFrame.style.height = '900px'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need these tricks? I see it's a copy'n'paste from positioning.js, to get around #1076, however I cannot reproduce issue described in this ticket.
'test panel refresh position': function( editor, bot ) { | ||
|
||
bot.setData( '<figure class="image"><img src="' + bender.basePath + '/_assets/lena.jpg"></figure>', function() { | ||
var balloonToolbar = new CKEDITOR.ui.balloonToolbarView( editor, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation after this var.
editor.widgets.instances[ 0 ].on( 'focus', function( evt ) { | ||
setTimeout( function() { | ||
editor.execCommand( 'sideImage', { widget: evt.sender } ); | ||
}, 5000 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it 3 secs? 5 seems like forever :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made it even 2 seconds ;)
I've moved unit test to |
…also causes context manager to be refreshed.
Both resize listeners seem to lay out better. In addition placed the document scroll listener in a single line, as it's not that long.
Tests are not ran on IE8, so there's no need for that.
Rebased onto latest master branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change shows me that now repositioning method could use some throttling. 🙂
What is the purpose of this pull request?
Bug fix
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
What changes did you make?
Added listener for
change
to balloon toolbar position refresher. The drawback of the current solution is the fact that balloon toolbar withoutundo
plugin won't refresh its position dynamically.Closes #1342.