Opened 7 years ago

Closed 7 years ago

#19924 closed Bug (fixed)

Some jQuery selectors in actions.js use hardcoded values instead of pulling from options.

Reported by: anonymous Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords: javascript
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no


This is equivalent to first_name = "Django"; last_name = "Reinhardt"; full_name = "Django Reinhardt";

If you specified custom options like I just did, you'll discover that the interactivity breaks because those selectors stop matching.

Attachments (1)

0001-fixed-selectors-in-actions.js-did-not-use-options.patch (1.7 KB) - added by crccheck 7 years ago.
sketch of the change to be made

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by crccheck

sketch of the change to be made

comment:1 Changed 7 years ago by crccheck

Well, that description I provided pretty much sucks. Here's another one:

If you're using a custom change_list.html admin template, where you have markup for the actions that differs from the default, but still want to use the existing actions.js javascript, it won't work. The "Select All" question won't click and neither will the "Clear" button. In my case, I renamed the "clear" class because it conflicted with an existing class that did clear:both and the clear button stopped working. There's no reason for this to happen though, because you can tell the javascript what selectors to look for. It just so happens that those buttons ignore what you say.

Here's the branch I'm working in:

Trac doesn't have an option for it, but there's a minified version that needs to be built too, and I don't know how that's done in this project.

On a tangential note, I'd rather not be forced to put an anchor tag inside those buttons, but that's a separate issue and a separate ticket if there's interest.

comment:2 Changed 7 years ago by Jacob

Triage Stage: UnreviewedAccepted

comment:3 Changed 7 years ago by polmuz

Component: contrib.authcontrib.admin
Patch needs improvement: set

I reviewed the code and it looks good.

Here are the instructions to compile the javascript for django

I think if you add that and you create a pull request this could be merged.

comment:4 Changed 7 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 4523fcd60101124a307bd4026296337087b66884:

Fixed #19924 -- Fixed selectors in actions.js that did not use options.

Note: See TracTickets for help on using tickets.
Back to Top