Opened 9 years ago

Closed 7 years ago

#11414 closed (fixed)

Calendar popup outside popup window in admin

Reported by: uipko Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords: calendar clock widget position popup
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


This problem occurs when editing a object, in the admin, in a popup window. For example object A has a reference to object B, while editing object A I create a new object B by clicking on the green plus. Now I have a popup with object B.

When the first field is a date field the top of the calendar widget disappears. The problem is in the openCaledar function, the widget is moved up for 75px but there is no checked if this will give a negative position. The openClock function has the same calculation, probably this problem doesn't occur as quick for the clock because it is smaller.

The following patch will fix this problem for the calendar and clock widget.

--- Django-1.0.2-final/django/contrib/admin/media/js/admin/DateTimeShortcuts.js.distrib	2008-11-19 06:44:27.000000000 +0100
+++ Django-1.0.2-final/django/contrib/admin/media/js/admin/DateTimeShortcuts.js	2009-07-02 17:24:15.000000000 +0200
@@ -105,7 +105,7 @@
             //       (it returns as it was left aligned), needs to be fixed.
    = findPosX(clock_link) - 110 + 'px';
- = findPosY(clock_link) - 30 + 'px';
+ = Math.max(0, findPosY(clock_link) - 30) + 'px';
         // Show the clock box = 'block';
@@ -221,7 +221,7 @@
             //       (it returns as it was left aligned), needs to be fixed.
    = findPosX(cal_link) - 180 + 'px';
- = findPosY(cal_link) - 75 + 'px';
+ = Math.max(0, findPosY(cal_link) - 75) + 'px';
      = 'block';
         addEvent(window, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; });

Change History (2)

comment:1 Changed 8 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:2 Changed 7 years ago by Ramiro Morales

Resolution: fixed
Status: newclosed

(In [15143]) Fixed #11414 -- Made sure the calendar and clock popup windows in the admin don't have a negative vertical position. Thanks uipko for the report and fix.

Note: See TracTickets for help on using tickets.
Back to Top