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

Fixes #924 Add four drag handles for image resizing #934

Merged
merged 3 commits into from
Nov 30, 2018

Conversation

diana-lin
Copy link

@diana-lin diana-lin commented Nov 30, 2018

Prelude

Currently, IE11 only has one resize handle when resizing an image within AlloyEditor while other browsers (Chrome, Firefox) have four. The task at hand is to implement resizing for IE11 such that it has a total of four drag handles and behaves in the same way as other browsers.

Issue

#924

Solution

  • Add styling for the four drag handles on the image resizer (one drag handle on each corner).
  • Add four drag handles as child elements of the image resizer, each with its proper CSS style
    • factorX and factorY can be either +1 or -1, and they take into account which drag handle is being used.
    • Height and width adjustment with adjustToX() and adjustToY() methods use factorX and factorY to determine whether to enlarge or shrink an image.
  • No longer need to consider left, center, or right alignment since resizing behaves the same way

Test

This fix has been tested on Internet Explorer 11, the main environment where we use dragresize_ie11.js.

Notes

  • Re-sending this as a fixed PR from Fixes #924 Add four drag handles for image resizing #925
  • With this change, the drag handles for images on IE11 are off-set in Liferay portal. Refinements to their positioning will be made separately in the Liferay repositories since this behaviour is specific to the Liferay portal

@julien
Copy link
Contributor

julien commented Nov 30, 2018

Just started reviewing :)

:octocat: Sent from GH.

@julien julien merged commit 73f4729 into liferay:develop Nov 30, 2018
@julien
Copy link
Contributor

julien commented Nov 30, 2018

@diana-lin thanks!

@diana-lin
Copy link
Author

Hi @julien,

Could you provide me with a rough estimate of when the next release containing this fix will be? It's relevant to a client's ticket (https://issues.liferay.com/browse/LPP-32171) and I'd like to give them an update.

@julien
Copy link
Contributor

julien commented Dec 5, 2018

Hi @diana-lin,

Yes sure we're still working on fixing a few issues, but we're planning to release a new version with this fix by the end of this week (12/07/2018) and we'll also update alloy-editor in liferay-portal.

@diana-lin
Copy link
Author

Hi @julien,

Great, thank you for the update. I will watch for the release.

@duracell80
Copy link

This was in Fixpack 70 for DXP 7.0 which just came out this week. There seems to be a number of issues with this inside the portal. I'll do my best to explain what is being seen but one of the issues involves anti-sammy stripping out the inline style upon re-editing content and only in IE11.

On existing content that did have html attributes and this is relating to the new resize (4 drag handles) the html attribute setting width is causing the image to distort when resizing "diagonally" in any of the 4 directions.

Chrome will actually set the height to auto, whereas IE11 will set the height to a pixel unit.

@diana-lin
Copy link
Author

Hi @duracell80,

From my understanding, the issue that is being described is analogous to #925 (comment). I have created a ticket for this which can be tracked here: https://issues.liferay.com/browse/LPS-90100.

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.

3 participants