Opened 10 years ago
Last modified 10 years ago
#24406 closed Cleanup/optimization
SelectFilter should use click events instead of href javascript functions — at Initial Version
Reported by: | Rolf Jagerman | Owned by: | nobody |
---|---|---|---|
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
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/rjagerman/django/commit/e07a0be20d6da81794eaa5b64c2927cc6c70410d
Note:
See TracTickets
for help on using tickets.
SelectFilter2.js git diff