Issue 517: IE8 Invalid Argument line 2297 outerWidth
Status:  Released
Owner: ----
Closed:  Aug 2013
Reported by asmund.h...@gmail.com, Jun 11, 2010
I am using FullCalendar 1.4.6 * Date: Mon May 31 10:18:29 2010 -0700

When resizing the window with the calendar in or when there are too many events in the same timeslot, outerwidth becomes negative. This causes IE8 to complain about invalid argument for line 2297 in fullcalendar.js and stop executing scripts.

Line 2297:

eventElement[0].style.width = seg.outerWidth - seg.hsides + 'px';

It seems it is the result of subtracting something on line 2229 (12/2):

outerWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer =

I fixed it temporarily on line 2297 by changing the line:
eventElement[0].style.width = seg.outerWidth - seg.hsides + 'px';
to:
if (seg.outerWidth - seg.hsides < 0) {
	eventElement[0].style.width = '1px';
}
else {
	eventElement[0].style.width = seg.outerWidth - seg.hsides + 'px';
}

This is obviously not the best way of doing this, but I don't have enough knowledge of what is going on. It would be great to have a fix for this problem.
fullcalendar.js
99 KB   View   Download
Jun 11, 2010
#1 asmund.h...@gmail.com
And ofcourse by resizing I meant horizontally and also this only happens in agenda views.
Jun 16, 2010
Project Member #2 adamrs...@gmail.com
i believe you when you say this problem is happening, but i would like to understand *why* it is happening before apply a fix. can you please post an online example or a ZIP containing everything needed to recreate the bug? ideally i would just run your example, resize my window (or whatever) and see the error occur. thanks
Jul 5, 2010
Project Member #3 adamrs...@gmail.com
 Issue 537  has been merged into this issue.
Aug 1, 2010
#4 asmund.h...@gmail.com
An example is posted at: http://herikstad001.hostzi.com/
This example is using version 1.4.7 of the fullcalendar and so the error is at line 2330 instead of 2297 in version 1.4.6.
Aug 17, 2010
#5 ian.pea...@dezrez.com
Hi Adam
I have had the same problem.

It only happens when it is linked to a google calendar, I don't know if this helps at all. Asmunds cure works for me too! ;)

Kind regards

Ian
Aug 26, 2010
Project Member #6 adamrs...@gmail.com
asmund,
thank you very much for your example. i was able to recreate the problem. it definitely needs to be fixed. will get it in the next release.

btw, i would do a very similar solution...

   eventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';
Status: Accepted
Labels: Type-Defect
Aug 31, 2010
#7 thorha...@gmail.com
This same problem occurs in setOuterHeight so it would be good to apply the same fix there as well.  Thanks.
Oct 16, 2010
Project Member #8 adamrs...@gmail.com
fixed this in 1.4.8 (just released). thanks for the reports
Status: Fixed
Aug 13, 2013
Project Member #9 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Implemented
Aug 13, 2013
Project Member #10 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Released