Skip to content

Commit

Permalink
Fixed #11414 -- Made sure the calendar and clock popup windows in the…
Browse files Browse the repository at this point in the history
… 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
ramiro committed Jan 4, 2011
1 parent 60470e8 commit efcaec1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions django/contrib/admin/media/js/admin/DateTimeShortcuts.js
Expand Up @@ -94,7 +94,7 @@ var DateTimeShortcuts = {
openClock: function(num) { openClock: function(num) {
var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num) var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num)
var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName+num) var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName+num)

// Recalculate the clockbox position // Recalculate the clockbox position
// is it left-to-right or right-to-left layout ? // is it left-to-right or right-to-left layout ?
if (getStyle(document.body,'direction')!='rtl') { if (getStyle(document.body,'direction')!='rtl') {
Expand All @@ -107,8 +107,8 @@ var DateTimeShortcuts = {
// (it returns as it was left aligned), needs to be fixed. // (it returns as it was left aligned), needs to be fixed.
clock_box.style.left = findPosX(clock_link) - 110 + 'px'; 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 // Show the clock box
clock_box.style.display = 'block'; clock_box.style.display = 'block';
addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; }); addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; });
Expand Down Expand Up @@ -224,8 +224,8 @@ var DateTimeShortcuts = {
// (it returns as it was left aligned), needs to be fixed. // (it returns as it was left aligned), needs to be fixed.
cal_box.style.left = findPosX(cal_link) - 180 + 'px'; 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'; cal_box.style.display = 'block';
addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; }); addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; });
}, },
Expand Down

0 comments on commit efcaec1

Please sign in to comment.