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

T/719 Image could be resized in read-only mode #757

Merged
merged 11 commits into from
Aug 29, 2017
Merged

T/719 Image could be resized in read-only mode #757

merged 11 commits into from
Aug 29, 2017

Conversation

beatadelura
Copy link
Contributor

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

Yes

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

A new condition has been added to prevent initializing resizer.


Closes #719

@@ -428,8 +428,10 @@

// Setup dynamic image resizing with mouse.
// Don't initialize resizer when dimensions are disallowed (http://dev.ckeditor.com/ticket/11004).
if ( editor.filter.checkFeature( this.features.dimension ) && editor.config.image2_disableResizer !== true )
// Don't initialize resizer when config.readOnly is set to true (#719).
if ( editor.filter.checkFeature( this.features.dimension ) && editor.config.image2_disableResizer !== true && editor.config.readOnly != true ) {
Copy link
Member

Choose a reason for hiding this comment

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

What if the editor is in read-only mode because someone uses editor.setReadOnly method (before initializing widgets), not a configuration option?

Such possibility introduces even more problematic question: what if read-only mode would change during using an editor? I honestly don't know how to fix such issue in the current version of editor as we don't have something like "refresh" method for widgets, which can listen to any changes in the editor and react accordingly.

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!

@Comandeer Comandeer merged commit 51c188c into master Aug 29, 2017
@Comandeer Comandeer deleted the t/719 branch August 29, 2017 15:57
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.

2 participants