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

thumbnail behavior in widget broken - does not disappear on clear #1505

Closed
gradel opened this issue Oct 28, 2024 · 8 comments
Closed

thumbnail behavior in widget broken - does not disappear on clear #1505

gradel opened this issue Oct 28, 2024 · 8 comments

Comments

@gradel
Copy link

gradel commented Oct 28, 2024

Possible bug introduced here:
f919cbf#diff-b4f795d97b769d1875bca80a02e74dd46438e9ebd2a39a818d3999ad8fea0ca3L29
This leads to detail becoming True in file_icon templatetag and then in file_icon_context and get_aspect_ratio_and_download_url , where therefore download_url gets added to the context what in turn in file_icon.html lets the img element get selected which is lacking the thumbnail_img class. The filer_clear function
in addons/widget.js thus can not find the img: var thumbnail = container.find('.thumbnail_img');.

@cobia
Copy link

cobia commented Nov 10, 2024

I have somewhat similar problems. Needed to override admin_file.html and removed detail=True.

django==4.2.16
django-filer==3.2.3

@mrbazzan
Copy link

@gradel
How do I recreate this issue? I would like to give it a try

@gradel
Copy link
Author

gradel commented Nov 13, 2024

@mrbazzan Just use the current version of django-filer. Then in the admin interface add a image, save the model (page or whatever the ImageField is attached to).
When now clicking the red "clear" X the image doesn't disappear.

Screenshot from 2024-11-14 00-26-00

@cobia yes, I replaced "detail" with the former '80x80' string.

@mrbazzan
Copy link

@mrbazzan Just use the current version of django-filer. Then in the admin interface add a image, save the model (page or whatever the ImageField is attached to). When now clicking the red "clear" X the image doesn't disappear.

I have added an image, saved the model and can still remove the image.
Am I doing something wrong?

Screenshot from 2024-11-14 00-26-00

I am unable to view this image.

@gradel
Copy link
Author

gradel commented Nov 17, 2024

@mrbazzan The issue is not about saving/removing the image from its model. Its just about the javascript driven behavior of the editing interface before saving. As soon as the remove button is clicked the thumbnail used to disappear immediately. And as soon as you chose another image a thumbnail of it used to be displayed immediately before any saving of the model.

Image is here too:

https://www.gerald-hien.de/media/filer_public/08/33/0833a824-125c-4998-8b99-909a24bf3d45/screenshot_from_2024-11-14_00-26-00.png

@mrbazzan
Copy link

@mrbazzan The issue is not about saving/removing the image from its model. Its just about the javascript driven behavior of the editing interface before saving. As soon as the remove button is clicked the thumbnail used to disappear immediately. And as soon as you chose another image a thumbnail of it used to be displayed immediately before any saving of the model.

Now I understand the problem. Thanks. 👍🏿

Image is here too:
Thanks for the image

@mrbazzan
Copy link

mrbazzan commented Dec 5, 2024

This issue can be closed as #1511 fixed it too, right?

@gradel
Copy link
Author

gradel commented Dec 6, 2024

@mrbazzan: Yes!

@fsbraun fsbraun closed this as completed Dec 6, 2024
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

No branches or pull requests

4 participants