jQuery forward compatibility: TabularInline with extra = 0: "Add another" wraps in <div> instead of <tr> inside of <table>
|Reported by:||jpic||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
To reproduce the bug, set extra = 0 in a TabularInline. Then open the admin page with the inline table, the "Add another" link is in a tr/td inside the table. Click "Add another" and it will add a row and wrap the "Add another" link inside a <div> instead of tr/td.
It is semantically wrong (a <div> may not have <table> for parent) and displays wrong ("Add another X" shouldn't wordwrap).
To fix the bug, change in https://code.djangoproject.com/browser/django/trunk/django/contrib/admin/static/admin/js/inlines.js#L44:
$(this).attr("tagName") == "TR"
FTR is there a better way than this command to enable non-compressed admin js ?
ln -Lfn ../env/lib/python2.7/site-packages/django/contrib/admin/media/js/inlines.js static/admin/js/inlines.min.js
Change History (5)
comment:1 Changed 5 years ago by bpeschier
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to needsinfo
- Status changed from new to closed
comment:3 Changed 5 years ago by jpic
- Resolution needsinfo deleted
- Status changed from closed to reopened
- Summary changed from TabularInline with extra = 0: "Add another" wraps in <div> instead of <tr> inside of <table> to jQuery forward compatibility: TabularInline with extra = 0: "Add another" wraps in <div> instead of <tr> inside of <table>
comment:4 Changed 5 years ago by aaugustin
- Resolution set to fixed
- Status changed from reopened to closed