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
--
Ticket URL: <https://code.djangoproject.com/ticket/24406>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0
Old 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
New 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/tree/ticket_24406
https://github.com/rjagerman/django/commit/e07a0be20d6da81794eaa5b64c2927cc6c70410d
--
--
Ticket URL: <https://code.djangoproject.com/ticket/24406#comment:1>
* owner: nobody => rjagerman
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/24406#comment:2>
Old 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/tree/ticket_24406
> https://github.com/rjagerman/django/commit/e07a0be20d6da81794eaa5b64c2927cc6c70410d
New 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/django/django/pull/4205
https://github.com/rjagerman/django/tree/ticket_24406
https://github.com/rjagerman/django/commit/e07a0be20d6da81794eaa5b64c2927cc6c70410d
--
--
Ticket URL: <https://code.djangoproject.com/ticket/24406#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"fa9cb5dcdc816fe0e606b8f1020d53526e08b0d4"]:
{{{
#!CommitTicketReference repository=""
revision="fa9cb5dcdc816fe0e606b8f1020d53526e08b0d4"
Fixed #24406 -- Improved SelectFilter js to use click events
The SelectFilter widget used href to execute javascript. This was
problematic if one wishes to customize the widget, since the href
javascript is executed after events are handled. This change modifies
the javascript to use click events to handle button behavior.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24406#comment:4>