Author: ramiro Date: 2011-01-12 17:57:45 -0600 (Wed, 12 Jan 2011) New Revision: 15180
Modified: django/branches/releases/1.2.X/django/contrib/admin/media/js/admin/DateTimeShortcuts.js Log: [1.2.X] 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. Backport of [15143] from trunk. Modified: django/branches/releases/1.2.X/django/contrib/admin/media/js/admin/DateTimeShortcuts.js =================================================================== --- django/branches/releases/1.2.X/django/contrib/admin/media/js/admin/DateTimeShortcuts.js 2011-01-12 23:54:17 UTC (rev 15179) +++ django/branches/releases/1.2.X/django/contrib/admin/media/js/admin/DateTimeShortcuts.js 2011-01-12 23:57:45 UTC (rev 15180) @@ -94,7 +94,7 @@ openClock: function(num) { var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num) var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName+num) - + // Recalculate the clockbox position // is it left-to-right or right-to-left layout ? if (getStyle(document.body,'direction')!='rtl') { @@ -107,8 +107,8 @@ // (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'; addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; }); @@ -224,8 +224,8 @@ // (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.document, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; }); }, -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.