Skip to content

Commit

Permalink
another bugfix for calendar resizing + iframes
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Feb 22, 2010
1 parent d1d5419 commit 229c9c3
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ $.fn.fullCalendar = function(options) {
date = new Date(),
viewName, // the current view name (TODO: look into getting rid of)
view, // the current view
viewInstances = {};
viewInstances = {},
absoluteViewElement;



Expand Down Expand Up @@ -214,7 +215,9 @@ $.fn.fullCalendar = function(options) {
(view = viewInstances[v]).element.show();
}else{
view = viewInstances[v] = $.fullCalendar.views[v](
newViewElement = $("<div class='fc-view fc-view-" + v + "' style='position:absolute'/>").appendTo(content),
newViewElement = absoluteViewElement =
$("<div class='fc-view fc-view-" + v + "' style='position:absolute'/>")
.appendTo(content),
options
);
}
Expand All @@ -226,10 +229,7 @@ $.fn.fullCalendar = function(options) {
}

view.name = viewName = v;
render();
if (newViewElement) {
newViewElement.css('position', 'relative');
}
render(); // after height has been set, will make absoluteViewElement's position=relative, then set to null
content.css('overflow', '');
if (oldView) {
setMinHeight(content, 1);
Expand Down Expand Up @@ -779,6 +779,10 @@ $.fn.fullCalendar = function(options) {
function setSize(dateChanged) {
ignoreWindowResize++;
view.setHeight(suggestedViewHeight, dateChanged);
if (absoluteViewElement) {
absoluteViewElement.css('position', 'relative');
absoluteViewElement = null;
}
view.setWidth(content.width(), dateChanged);
ignoreWindowResize--;
}
Expand Down
96 changes: 96 additions & 0 deletions tests/issue_333_blinking.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type='text/javascript' src='loader.js'></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({

defaultView: 'agendaDay',
minTime: 0,
maxTime: 24,
firstDay: 1,
allDayText: "dieną",

events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
},
{
title: 'Long Event',
start: new Date(y, m, d-5),
end: new Date(y, m, d-2)
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d-3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d+4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d+1, 19, 0),
end: new Date(y, m, d+1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
],

header: {
left: 'prev',
center: 'title',
right: 'next next next'
},
allDaySlot: true,
editable: true,
titleFormat:
{
month: 'MMMM yyyy', // September 2009
week: "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}", // Sep 7 - 13 2009
day: 'dddd' // Tuesday, Sep 8, 2009
},

axisFormat: 'HH(:mm)',
timeFormat: { agenda: 'HH:mm{ - HH:mm}' },
weekends: true
});

});


</script>

<body>
<div id="calendar"> </div>
</body>
</html>

0 comments on commit 229c9c3

Please sign in to comment.