Permalink
Browse files

Fixed #9642 -- Made the admin calendar/clock popups go away when the…

… users clicks outside them. The previous javascript code did not work on IE. Thanks northtea for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9514 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
kmtracey committed Nov 21, 2008
1 parent 2967106 commit 380e31ddb7cbc56d738dd78f176d03e1c94c27a5
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/contrib/admin/media/js/admin/DateTimeShortcuts.js
@@ -109,11 +109,11 @@ var DateTimeShortcuts = {
// Show the clock box
clock_box.style.display = 'block';
- addEvent(window, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; });
+ addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; });
},
dismissClock: function(num) {
document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none';
- window.onclick = null;
+ window.document.onclick = null;
},
handleClockQuicklink: function(num, val) {
DateTimeShortcuts.clockInputs[num].value = val;
@@ -224,10 +224,11 @@ var DateTimeShortcuts = {
cal_box.style.top = findPosY(cal_link) - 75 + 'px';
cal_box.style.display = 'block';
- addEvent(window, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; });
+ addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; });
},
dismissCalendar: function(num) {
document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none';
+ window.document.onclick = null;
},
drawPrev: function(num) {
DateTimeShortcuts.calendars[num].drawPreviousMonth();

0 comments on commit 380e31d

Please sign in to comment.