﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11414	Calendar popup outside popup window in admin	uipko	nobody	"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.
             clock_box.style.left = findPosX(clock_link) - 110 + 'px';
         }
-        clock_box.style.top = findPosY(clock_link) - 30 + 'px';
+        clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px';
     
         // Show the clock box
         clock_box.style.display = 'block';
@@ -221,7 +221,7 @@
             //       (it returns as it was left aligned), needs to be fixed.
             cal_box.style.left = findPosX(cal_link) - 180 + 'px';
         }
-        cal_box.style.top = findPosY(cal_link) - 75 + 'px';
+        cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px';
     
         cal_box.style.display = 'block';
         addEvent(window, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; });
}}}"		closed	contrib.admin	1.0		fixed	calendar clock widget position popup		Accepted	1	0	0	0	0	0
