Skip to content

Commit 2be79de

Browse files
committed
Extras.CalendarSelect fixes for IE 9
Provided by ScoPi http://echo.nextapp.com/site/node/6715 This commit propably needs a review as stated in the message: So admittedly this may not be the most appropriate way to fix the underlying issue, but the bug we've seen in IE 9 when using the Extras.CalendarSelect control is addressed by this. The symptoms of the bug were two-fold: 1. The month select field could not be used. It didn't appear to respond to mouse clicks and open. 2. You had to double-click on a particular day in a month grid to select it as opposed to one click. The reason for the above problems appears to have been related to a runaway recursive call that only affected IE 9. The below fixes this issue specifically for Internet Explorer 9, and everything still appears to work fine.
1 parent bd02845 commit 2be79de

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

src/client/extras/Sync.CalendarSelect.js

100644100755
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -914,10 +914,25 @@ Extras.Sync.CalendarSelect = Core.extend(Echo.Render.ComponentSync, {
914914
Core.Web.Event.add(this._calendarDiv, "mouseout", Core.method(this, this._processDateRolloverExit), false);
915915

916916
this._updateMonthYearSelection();
917-
918-
Core.Web.Image.monitor(this._div, Core.method(this, function() {
919-
this._renderSizeUpdate();
920-
}));
917+
// This stuff handles the runaway recursion that happens in IE 9
918+
if (this._numMonitorRegistrations === undefined) {
919+
this._numMonitorRegistrations = 0;
920+
}
921+
922+
var registerMonitor = true;
923+
if ( (Core.Web.Env.BROWSER_INTERNET_EXPLORER && (Core.Web.Env.BROWSER_VERSION_MAJOR >= 9)) ) {
924+
if (this._numMonitorRegistrations > 1) {
925+
this._numMonitorRegistrations = 0;
926+
registerMonitor = false;
927+
}
928+
}
929+
930+
if (registerMonitor) {
931+
this._numMonitorRegistrations++;
932+
Core.Web.Image.monitor(this._div, Core.method(this, function() {
933+
this._renderSizeUpdate();
934+
}));
935+
}
921936
},
922937

923938
/** @see Echo.Render.ComponentSync#renderDispose */

0 commit comments

Comments
 (0)