Browse files

[1.0.X] Fixed #9642 -- Made the admin calendar/clock popups go away w…

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

r9514 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 3ea4dd1 commit 33dac7afd73e70abd976ce1a68a23aab743349e5 @kmtracey kmtracey committed Nov 21, 2008
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/contrib/admin/media/js/admin/DateTimeShortcuts.js
View
7 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 33dac7a

Please sign in to comment.