Skip to content

Commit

Permalink
fixed issue 517
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Oct 12, 2010
1 parent 453fcf0 commit 1176a74
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/agenda/AgendaEventRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,9 @@ function AgendaEventRenderer() {
for (i=0; i<segCnt; i++) {
seg = segs[i];
if (eventElement = seg.element) {
eventElement[0].style.width = seg.outerWidth - seg.hsides + 'px';
eventElement[0].style.height = (height = seg.outerHeight - seg.vsides) + 'px';
eventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';
height = Math.max(0, seg.outerHeight - seg.vsides);
eventElement[0].style.height = height + 'px';
event = seg.event;
if (seg.titleTop !== undefined && height - seg.titleTop < 10) {
// not enough room for title, put it in the time header
Expand Down
2 changes: 1 addition & 1 deletion src/common/DayEventRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function DayEventRenderer() {
for (i=0; i<segCnt; i++) {
seg = segs[i];
if (eventElement = seg.element) {
eventElement[0].style.width = seg.outerWidth - seg.hsides + 'px';
eventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ function lazySegBind(container, segs, bindHandlers) {

function setOuterWidth(element, width, includeMargins) {
element.each(function(i, _element) {
_element.style.width = width - hsides(_element, includeMargins) + 'px';
_element.style.width = Math.max(0, width - hsides(_element, includeMargins)) + 'px';
});
}


function setOuterHeight(element, height, includeMargins) {
element.each(function(i, _element) {
_element.style.height = height - vsides(_element, includeMargins) + 'px';
_element.style.height = Math.max(0, height - vsides(_element, includeMargins)) + 'px';
});
}

Expand Down
127 changes: 127 additions & 0 deletions tests/issue_517_js_error_ie.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script type='text/javascript' src='../src/_loader.js?debug'></script>
<script type='text/javascript'>

$(document).ready(function() {

var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();

$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
},
defaultView: 'agendaWeek',
events: [
{
title: 'Event1',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event2',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event3',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event4',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event5',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event6',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event7',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event8',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event9',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event10',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event11',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event12',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event13',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event14',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event15',
start: new Date(y, m, d, 6, 0),
allDay : false
},
{
title: 'Event16',
start: new Date(y, m, d, 6, 0),
allDay : false
}
]
});

});

</script>
<style type='text/css'>

body {
margin-top: 40px;
text-align: center;
font-size: 13px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}

#calendar {
width: 400px;
margin: 0 auto;
}

</style>
</head>
<body>
<div id='calendar'></div>
</body>
</html>

0 comments on commit 1176a74

Please sign in to comment.