mirror of https://github.com/django/django.git
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
This commit is contained in:
parent
2967106274
commit
380e31ddb7
|
@ -109,11 +109,11 @@ var DateTimeShortcuts = {
|
||||||
|
|
||||||
// Show the clock box
|
// Show the clock box
|
||||||
clock_box.style.display = 'block';
|
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) {
|
dismissClock: function(num) {
|
||||||
document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none';
|
document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none';
|
||||||
window.onclick = null;
|
window.document.onclick = null;
|
||||||
},
|
},
|
||||||
handleClockQuicklink: function(num, val) {
|
handleClockQuicklink: function(num, val) {
|
||||||
DateTimeShortcuts.clockInputs[num].value = val;
|
DateTimeShortcuts.clockInputs[num].value = val;
|
||||||
|
@ -224,10 +224,11 @@ var DateTimeShortcuts = {
|
||||||
cal_box.style.top = findPosY(cal_link) - 75 + 'px';
|
cal_box.style.top = findPosY(cal_link) - 75 + 'px';
|
||||||
|
|
||||||
cal_box.style.display = 'block';
|
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) {
|
dismissCalendar: function(num) {
|
||||||
document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none';
|
document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none';
|
||||||
|
window.document.onclick = null;
|
||||||
},
|
},
|
||||||
drawPrev: function(num) {
|
drawPrev: function(num) {
|
||||||
DateTimeShortcuts.calendars[num].drawPreviousMonth();
|
DateTimeShortcuts.calendars[num].drawPreviousMonth();
|
||||||
|
|
Loading…
Reference in New Issue