Opened 18 years ago
Closed 12 years ago
#4045 closed Bug (fixed)
some admin Javascript fixes and cleanups
Reported by: | arvin | Owned by: | andrewjesaitis |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | admin calendar |
Cc: | andrewjesaitis | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
I recognised that the calendar behaves a bit different in Konqueror than in
Firefox: When clicking inside the calendar but not on a element with
functionality (e.g. month name) the calendar is closed in Konqueror but not in
Firefox. This lead me to the first part of my patch:
- Attach "onclick" events to "document" instead of "window". Konqueror does not deliver the event to "window" even when the propagation was stopped. Internet Explorer (tested with IE6 SP2 at a friend computer) does not deliver the event at all to "window". AFAIK "window" in not part of DOM so "document" should be more portable. I have tested the new code with Firefox, Explorer, Safari, Konqueror and Opera.
The other parts are only minor cleanups:
- Event handlers set in openClock/openCalendar are removed in dismissClock/dismissCalendar ("window.onclick = null;" does not work since handlers are installed with addEvent).
- Calendar inserts dates with leading zeroes.
- Remove duplicates of functions "quickElement" and "addEvent".
- Move "removeChildren" and "cancelEventPropagation" to "core.js" as they might be handy also at other places.
If you want a patch with only some parts included let me know.
Attachments (1)
Change History (13)
by , 18 years ago
Attachment: | admin-js.diff added |
---|
comment:1 by , 18 years ago
Component: | Uncategorized → Admin interface |
---|---|
Owner: | changed from | to
Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 18 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
comment:3 by , 18 years ago
The patch with the pure cleanup is in ticket #4120.
Since a patch with the pure changes would conflict I thinks it's best I make a new
patch against the SVN for this ticket when the other thing is through.
comment:4 by , 17 years ago
Owner: | changed from | to
---|
Reassigning to xian since he's doing admin JS stuff.
comment:5 by , 15 years ago
Owner: | changed from | to
---|
xian obviously isn't doing anything with this. Patch needs to be updated to current js.
comment:6 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:7 by , 13 years ago
Easy pickings: | unset |
---|---|
UI/UX: | unset |
A js bug-fix for a 4 year old browser version? Perhaps this should just be silently closed?
comment:8 by , 12 years ago
Much of the patch still applies (with cd django/contrib/admin/static/admin/js; patch -p0 < admin-js.diff
).
comment:9 by , 12 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Picking this up, but ticket #4120 is a prerequisite, so I'll wait on doing anything until that ticket is resolved. However, it looks like most of the things that need to be fixed -- attaching events to the document instead of window, have occurred during the intervening years. The only remaining thing would be to "more properly" remove the events using core.js removeEvent function rather that just setting window.document.onclick = null.
comment:10 by , 12 years ago
This is the remaining piece of the patch for ticket 4045. All we are doing is using the core.js removeEvent to unbind the dismissClock and dismissCalendar functions from the click event. https://github.com/django/django/pull/989
comment:12 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I believe we still support IE5.5/Win as much as possible, so I'd like to hear that this patch works there, too, before checking in.
Sprry to be a pain, but please split the patch into two parts: changes that don't affect any functionality (the "clean-ups") and changes that fix an actual bug. Make a new ticket for the clean-up portions. That way we can evaluate the real problem-fixes in isolation.