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

Unchecking enlarge on click not working #69

Closed
ebincm opened this issue Oct 18, 2019 · 2 comments · Fixed by #94
Closed

Unchecking enlarge on click not working #69

ebincm opened this issue Oct 18, 2019 · 2 comments · Fixed by #94
Labels
bug wip work in progress

Comments

@ebincm
Copy link

ebincm commented Oct 18, 2019

Use Case in
TYPO3 9.5.9 - LTS
rte_ckeditor_image - 9.0.3
Added an image with a popup in the ckeditor by enabling enlarge on click checkbox. It saves correctly in the CKEditor with the data-zoom attribute as true.
But when unchecking enlarge on click this data-zoom attribute persists & unable to save the same image without a popup.

@CybotTM CybotTM added the bug label Oct 28, 2019
@hoermannklaus
Copy link

hoermannklaus commented Feb 3, 2020

I encounter the same problem having TYPO3 version 9.5.13 and rte_ckeditor_image version 9.0.4..

I select the image in the CKEditor and choose the "Image properties". In the shown overlay page, I enter the desired values:

  • Width: 400
  • Height: 267 (calculated automatically)
  • Click enlarge: "no" -> false
  • Title: No checkbox, empty text
  • Alt text: "Test image"

I then hit ok. When I look at the source code it has correct set

  • data-htmlarea-file-uid: "2062" --> This is the correct file.
  • width: "400" -> This is correct.
  • height: "267" -> This is correct.
  • alt: "Test image" -> This is correct.
  • data.htmlarea-zoom: "true" --> This is false! Should be "false" or not in it at all
  • title: "Test Image 2" --> This is false! I set the text to empty, and removed the checkmark

It seems to me, that the values are not getting into the bodytext of the tt_content element correctly.

Then I thought: What if I change the values in the Source Code view of the CKEditor? I changed the following attributes and clicked "Save":

  • title: Removed tag completelty --> Frontend: Would still render IMG tag with title attribute holding value "Test Image 2", which is the default value i believe.
  • data-htmlarea-zoom: "false" --> Frontend: The link around the image would still be a lightbox link.
  • width: "500" --> Would not work on save. After saving the values would still be 400. This is maybe because of the fact, that I did not change the "height" property accordingly. I used the overlay to change the width to 500, which changed the height to 333. Then I could save the dimension changes. But when I use the dialog window I would again get the "data-htmlarea-zoom" attribute, which must be deleted again....

The rendering itselfs also seems to have troubles displaying values correctly.

Then I removed the "data-htmlarea-zoom" attribute completly, which resulted in no link around the images in the frontend.

EDIT: I see... Maybe "zoom" ist not "clickenlarge". But there is no "clickenlarge" attribute when returning from the overlay image configuration. Only a "data-htmlarea-zoom" attribute.

@zelcode
Copy link

zelcode commented Jul 23, 2020

Hey people,
is there life here, there is already 10.4.5 LTS

You can check if this is good enough, tested on 10.4.5 LTS and this dev-10.x

if ($zoom.prop('checked')) {
  // When saving the zoom property is saved as the new `zoom` attribute
  attributes['data-htmlarea-zoom'] = true
// If unchecked, remove zoom attributes
} else if (attributes['data-htmlarea-zoom'] || attributes['data-htmlarea-clickenlarge']) {
  attributes = null
}
return attributes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug wip work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants