Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit efcaec19236464ab36414073bc378bf0afccf42f 1 parent 60470e8
Ramiro Morales authored January 04, 2011
10  django/contrib/admin/media/js/admin/DateTimeShortcuts.js
@@ -94,7 +94,7 @@ var DateTimeShortcuts = {
94 94
     openClock: function(num) {
95 95
         var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num)
96 96
         var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName+num)
97  
-    
  97
+
98 98
         // Recalculate the clockbox position
99 99
         // is it left-to-right or right-to-left layout ?
100 100
         if (getStyle(document.body,'direction')!='rtl') {
@@ -107,8 +107,8 @@ var DateTimeShortcuts = {
107 107
             //       (it returns as it was left aligned), needs to be fixed.
108 108
             clock_box.style.left = findPosX(clock_link) - 110 + 'px';
109 109
         }
110  
-        clock_box.style.top = findPosY(clock_link) - 30 + 'px';
111  
-    
  110
+        clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px';
  111
+
112 112
         // Show the clock box
113 113
         clock_box.style.display = 'block';
114 114
         addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; });
@@ -224,8 +224,8 @@ var DateTimeShortcuts = {
224 224
             //       (it returns as it was left aligned), needs to be fixed.
225 225
             cal_box.style.left = findPosX(cal_link) - 180 + 'px';
226 226
         }
227  
-        cal_box.style.top = findPosY(cal_link) - 75 + 'px';
228  
-    
  227
+        cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px';
  228
+
229 229
         cal_box.style.display = 'block';
230 230
         addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; });
231 231
     },

0 notes on commit efcaec1

Please sign in to comment.
Something went wrong with that request. Please try again.