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
generic JS usable when a row is duplicated when file is a part of a ManyToMany #463
Conversation
//if this file is included multiple time, we ensure that filer_clear is attached only once. | ||
$(document).off('click.filer', '.filerFile .filerClearer', filer_clear).on('click.filer', '.filerFile .filerClearer', filer_clear); | ||
}); | ||
})(jQuery); |
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.
This should be django.jQuery
to use the django-namespaced jQuery
Could you fix that?
Other than the above comment, LGTM, thanks @DylannCordel |
|
awesome! |
generic JS usable when a row is duplicated when file is a part of a ManyToMany
Thanks @DylannCordel |
Hi @evildmp I'll add a new paper marked "IE" in my "angry box"... Fixed in #568 Straight from the (recent) jQuery source : // We can't allow the type property to be changed (since it causes problems in IE)
if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
throw "type property can't be changed"; |
You right, but this is corrected since 10 january on this commit : 7b5fcc1 |
@DylannCordel The issue is affecting me in Safari though. With the change in #568 I now see:
|
I should add that the Filer widget itself now appears to work, even though I get that error, but I still find that it breaks other JS that my admin relies on. |
How to reproduce :
Use a FilerField in a ManyToMany, and use admin's inline to manage it in the admin form.
When "add new row" is clicked, the "clear" image is displayed and not functionnal.
This is because the old javascript is for the current ID, so new lines, with != IDs, couldn't work. This bug fix use classes and the jQuery(document).on function to watch event on newly created lines.