Skip to content

Commit

Permalink
clean aspectRatio option, setting height right after init bugfix, ie6…
Browse files Browse the repository at this point in the history
… button positioning bugfix, nixed cache option
  • Loading branch information
arshaw committed Dec 22, 2009
1 parent 6a5be40 commit b61b9d5
Show file tree
Hide file tree
Showing 9 changed files with 149 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/agenda.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Agenda(element, options, methods) {
var head, body, bodyContent, bodyTable, bg,
colCnt,
axisWidth, colWidth, slotHeight,
cachedDaySegs, cachedSlotSegs,
cachedDaySegs=[], cachedSlotSegs=[],
cachedHeight,
tm, firstDay,
nwe, // no weekends (int)
Expand Down
1 change: 0 additions & 1 deletion src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ table.fc-header {

.fc-header .fc-state-default a {
display: block;
position: relative;
border-width: 0 1px;
margin: 0 -1px;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion src/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function Grid(element, options, methods) {
rowCnt, colCnt,
colWidth,
thead, tbody,
cachedSegs, //...
cachedSegs=[], //...

// initialize superclass
view = $.extend(this, viewMethods, methods, {
Expand Down
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var defaults = {
// event ajax
startParam: 'start',
endParam: 'end',
cache: false,

// time formats
titleFormat: {
Expand Down Expand Up @@ -304,7 +303,7 @@ $.fn.fullCalendar = function(options) {
else if (options.height) {
return options.height - (header ? header.height() : 0) - horizontalSides(content);
}
return elementWidth / options.aspectRatio;
return elementWidth / Math.max(options.aspectRatio, .5);
}


Expand Down Expand Up @@ -366,7 +365,7 @@ $.fn.fullCalendar = function(options) {
url: src,
dataType: 'json',
data: params,
cache: options.cache,
cache: false,
success: reportEventsAndPop
});
}
Expand Down Expand Up @@ -830,4 +829,5 @@ function normalizeEvent(event, options) {
event.className = [];
}
}
// TODO: if there is no title or start date, return false to indicate an invalid event

1 change: 1 addition & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ var parseDate = fc.parseDate = function(s) {
}
return parseISO8601(s, true) || (s ? new Date(s) : null);
}
// TODO: never return invalid dates (like from new Date(<string>)), return null instead
return null;
}

Expand Down
51 changes: 51 additions & 0 deletions tests/issue_220_buttons_ie6.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!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'>DISABLE_FIREBUG_LITE=true</script>
<script type='text/javascript' src='loader.js'></script>
<script type='text/javascript'>

$(document).ready(function() {

$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
}
});

});

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

body {
margin: 0;
font-size: 13px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}

</style>
</head>
<body>
<div style='height:108px;position:relative'></div>
<div style='position:relative;margin-top:-50px;width:900px;z-index:2'>
<div style='position:relative;padding:3px'>

<div style='margin: 10px 20px 0'>Nav</div>

<div style='margin:20px 0 0;padding:0 20px'>

<p>
this is a paragraph
</p>

<div id='calendar' style='margin:3em 0;direction:ltr'></div>

</div>

</div>
</div>
</body>
</html>
45 changes: 45 additions & 0 deletions tests/issue_230_height_json_events.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel='stylesheet' type='text/css' href='../examples/redmond/theme.css' />
<script type='text/javascript' src='loader.js'></script>
<script type='text/javascript'>

$(document).ready(function() {

$('#calendar').fullCalendar({
year: 2009,
month: 10,
date: 22,
//defaultView: 'agendaWeek', // error also occured with month view
editable: true,
events: "../examples/json-events.php"
});

$('#calendar').fullCalendar('option', 'height', $(window).height()-80);
// shouldn't throw an error

});


</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: 900px;
margin: 0 auto;
}

</style>
</head>
<body>
<div id='calendar'></div>
</body>
</html>
44 changes: 44 additions & 0 deletions tests/issue_244_aspectRatio_0.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel='stylesheet' type='text/css' href='../examples/redmond/theme.css' />
<script type='text/javascript' src='loader.js'></script>
<script type='text/javascript'>

$(document).ready(function() {

$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay',
},
defaultView: 'agendaWeek', // month view also looked scrunched
aspectRatio: 0
});

// shouldnt allow aspectRatios to *actually* go under .5

});

</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: 900px;
margin: 0 auto;
}

</style>
</head>
<body>
<div id='calendar'></div>
</body>
</html>
4 changes: 3 additions & 1 deletion tests/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ if (_build) {
includeJS('../src/gcal.js');
}

includeJS('firebug-lite/firebug-lite-compressed.js');
if (!window.DISABLE_FIREBUG_LITE) {
includeJS('firebug-lite/firebug-lite-compressed.js');
}

window.onload = function() {
$('body').append(
Expand Down

0 comments on commit b61b9d5

Please sign in to comment.