Jump to content

Image resize issue in TinyMCE


Soma
 Share

Recommended Posts

I noticed that when I resize the image in TinyMCE in Chrome it wouldn't resize really. The dragged image is smaller and width and height set in image tag. But when saving and looking at source the image is still the original! I noticed this because of responsive image css with max-width: 100%; It wouldn't show scaled version but still same size.

In FF it worked and I tracked it down to in Chrome the click event check for the nodeName wouldn't return IMG for the first mousedown event for some reason. The check for the nodeName on the selection of TinyMCE would not return "IMG" . After trying to find a solution deperately I found a really minor fix that solves the issue in Chrome while it still works in FF. The trick is to just get the event.target instead.

And I hope in other browsers it still works too but I'm sure it will. But maybe with IE could test this out?

I made a pull request on the responsible TinyMCE PW plugin file.

https://github.com/ryancramerdesign/ProcessWire/pull/174


Changed file

https://github.com/somatonic/ProcessWire/blob/7c4d160152aae3aeb33b68a852c45c35008b0b54/wire/modules/Inputfield/InputfieldTinyMCE/plugins/advimagescale/editor_plugin.js

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...