-
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
T/719 Image could be resized in read-only mode #757
Conversation
plugins/image2/plugin.js
Outdated
@@ -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 ) { |
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.
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.
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.
LGTM!
What is the purpose of this pull request?
Bug fix
Does your PR contain necessary tests?
Yes
This PR contains
What changes did you make?
A new condition has been added to prevent initializing resizer.
Closes #719