Opened 10 years ago
Closed 10 years ago
#24406 closed Cleanup/optimization (fixed)
SelectFilter should use click events instead of href javascript functions
Reported by: | Rolf Jagerman | Owned by: | Rolf Jagerman |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | admin SelectFilter javascript |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
SelectFilter uses javascript in an href to handle button behavior:
<a href="javascript:function(){...}">
This is problematic if one wishes to customize the widget, since the href javascript is executed after events are handled. It would be better to use a click event to handle this type of behavior:
someElement.addEventListener("click", function() { ... } );
I have proposed a patch on github:
https://github.com/django/django/pull/4205
https://github.com/rjagerman/django/tree/ticket_24406
https://github.com/rjagerman/django/commit/e07a0be20d6da81794eaa5b64c2927cc6c70410d
Attachments (1)
Change History (5)
by , 10 years ago
Attachment: | selectfilter.diff added |
---|
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 10 years ago
Description: | modified (diff) |
---|
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
SelectFilter2.js git diff