[Django] #31483: Remove admin change_form.js dependency on jQuery.

12 views
Skip to first unread message

Django

unread,
Apr 19, 2020, 6:32:09 PM4/19/20
to django-...@googlegroups.com
#31483: Remove admin change_form.js dependency on jQuery.
------------------------------------------------+------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
https://github.com/django/django/blob/3.0/django/contrib/admin/static/admin/js/change_form.js

The file currently uses jQuery for two purposes:

1. To add an onclick handler to elements with the `add-another` class.
This event handler has been unused since
07988744b347302925bc6cc66511e34224db55ab (Django 1.8) when the class was
removed. Rather than porting and maintaining this code block, it can be
removed.

2. To find the first visible, enabled input and then focus it. This code
is simple enough to port.

--
Ticket URL: <https://code.djangoproject.com/ticket/31483>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 19, 2020, 6:35:44 PM4/19/20
to django-...@googlegroups.com
#31483: Remove admin change_form.js dependency on jQuery.
-------------------------------------+-------------------------------------

Reporter: Jon Dufresne | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jon Dufresne):

* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/12757

--
Ticket URL: <https://code.djangoproject.com/ticket/31483#comment:1>

Django

unread,
Apr 20, 2020, 12:59:49 AM4/20/20
to django-...@googlegroups.com
#31483: Remove admin change_form.js dependency on jQuery.
-------------------------------------+-------------------------------------
Reporter: Jon Dufresne | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* owner: nobody => Jon Dufresne
* status: new => assigned
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/31483#comment:2>

Django

unread,
Apr 22, 2020, 9:45:15 AM4/22/20
to django-...@googlegroups.com
#31483: Remove admin change_form.js dependency on jQuery.
-------------------------------------+-------------------------------------
Reporter: Jon Dufresne | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton@…>):

In [changeset:"a8bb53dbd24c90c280e90332d9a1f9f64efde3c7" a8bb53db]:
{{{
#!CommitTicketReference repository=""
revision="a8bb53dbd24c90c280e90332d9a1f9f64efde3c7"
Refs #31483 -- Removed CSS and JavaScript for unused HTML class add-
another.

The HTML class was removed in 07988744b347302925bc6cc66511e34224db55ab.
As such, the CSS and JavaScript is unused.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31483#comment:3>

Reply all
Reply to author
Forward
0 new messages