Hello!
jscalendar is not working in Internet Explorer 7. When the calendar button is pressed, the calendar pops-up but it freezes there, no interaction is possible. The error IE7 outputs is:
Line:15
Char:2636
Error: 'nodeType' is null or not an object
Code:0
nodeType is used in calendar_stripped.js at this place:

Calendar.getElement=function(ev){
var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;
while(f.nodeType!=1||/^div$/i.test(f.tagName))
f=f.parentNode;
return f;
}

Tested in Firefox 2, it works fine. Any ideas?

Comments

nedjo’s picture

I don't have IE7 handy to test. I would appreciate ideas on exactly what's causing the issue. I don't relish the idea of patching the jscalendar library.

drue’s picture

I can confirm that jscalendar, as packaged with jstools, doesn't work with IE 7. However, it won't even pop up for me in windows XP with IE 7.

The thing is, the original jscalendar library works fine with IE 7 for me. I verified that this is the same version that is installed with jstools, and installed jscalendar on my webserver and verified that it indeed works fine with IE 7 independently.

So, there's a (probably trivial) bug in the way drupal is calling jscalendar. I spent some time looking for it, and couldn't figure it out.

Here's a link to the jscalendar library: http://www.dynarch.com/projects/calendar/.

-drue

math0ne’s picture

I'm not 100% sure this is the same issue but my calendars were not working on long pages and this fixed it:

http://sourceforge.net/tracker/index.php?func=detail&aid=1679433&group_i...

cwalkabout’s picture

Thanks! That patch mostly fixed the problem for me. The popup now appears in IE7. Some notes from many of hours digging and learning the past few days:

1. I had to modify jscalendar.module to load the patched lib/calendar.js, because I don't know how to create a stripped js file. Anyone got a pointer for doing that? I'd love to reduce the size ...

2. Even though the popup now appears in IE, it doesn't appear in the right location -- it's about 210 pixels to the right. The call to Calendar.getAbsolutePos on line 1375 (for the location of the calendar graphic, I think) returns different results in IE7 and FF2, but I didn't know where to go from there, so I just hard coded an offset for IE. Ugly, but it works.

3. I ended up using a different patch from the one above, one which uses object detection instead of browser versions (see http://www.quirksmode.org/js/doctypes.html). At 1389 in calendar,js I replaced this:

if (Calendar.is_ie) {
	br.y += document.body.scrollTop;
	br.x += document.body.scrollLeft;
} else {
	br.y += window.scrollY;
	br.x += window.scrollX;
}

with this:

if (isset(document.documentElement) && isset(document.documentElement.scrollTop)) {
	br.y += document.documentElement.scrollTop;
	br.x += document.documentElement.scrollLeft;
}
else if (isset(document.body) && isset(document.body.scrollTop)) {
	br.y += document.body.scrollTop;
	br.x += document.body.scrollLeft;
} else {
	br.y += window.scrollY;
	br.x += window.scrollX;
}

with function isset(varname){ return(typeof(varname)!= 'undefined'); }

Today I discovered the new jquery_calendar module, but it's not integrated with Views yet, and didn't display properly in IE with the garland setup I have, so I have jscalendar for now.