fixed some small IE/FF scrolling and display bugs

- in IE 6/7, gap underneath views, mouseover caused error
- in FF, scrolling was sometimes set to top
- in agenda views, scrolling would reset on every event rerender
- during rendering of agenda view would cause document to get really tall
This commit is contained in:
Adam Shaw 2010-02-18 21:10:53 -08:00
parent e4ea11c3df
commit 987d029ba0
3 changed files with 21 additions and 13 deletions

View file

@ -200,7 +200,7 @@ function Agenda(element, options, methods) {
body.find('td').click(slotClick); body.find('td').click(slotClick);
// slot event container // slot event container
slotSegmentContainer = $("<div/>").appendTo(bodyContent); slotSegmentContainer = $("<div style='position:absolute;top:0;left:0'/>").appendTo(bodyContent);
// background stripes // background stripes
d = cloneDate(d0); d = cloneDate(d0);
@ -269,15 +269,15 @@ function Agenda(element, options, methods) {
body.scrollTop(timePosition(d0, scrollDate) + 1); // +1 for the border body.scrollTop(timePosition(d0, scrollDate) + 1); // +1 for the border
// TODO: +1 doesn't apply when firstHour=0 // TODO: +1 doesn't apply when firstHour=0
} }
if ($.browser.opera) { //if ($.browser.opera) {
setTimeout(go, 0); // opera 10 (and earlier?) needs this setTimeout(go, 0); // opera 10 (and earlier?) needs this
}else{ //}else{
go(); // go();
} //}
} }
function setHeight(height) { function setHeight(height, dontResetScroll) {
viewHeight = height; viewHeight = height;
slotTopCache = {}; slotTopCache = {};
@ -290,7 +290,9 @@ function Agenda(element, options, methods) {
height: height height: height
}); });
resetScroll(); //TODO: not the best place for this if (!dontResetScroll) {
resetScroll();
}
} }
@ -303,7 +305,7 @@ function Agenda(element, options, methods) {
var topTDs = head.find('tr:first th'), var topTDs = head.find('tr:first th'),
stripeTDs = bg.find('td'), stripeTDs = bg.find('td'),
clientWidth = slotSegmentContainer.width(); // body[0].clientWidth isn't reliable here in IE6 clientWidth = body[0].clientWidth;
bodyTable.width(clientWidth); bodyTable.width(clientWidth);
@ -454,7 +456,7 @@ function Agenda(element, options, methods) {
bindDaySegHandlers, bindDaySegHandlers,
modifiedEventId modifiedEventId
); );
setHeight(viewHeight); // might have pushed the body down, so resize setHeight(viewHeight, true); // might have pushed the body down, so resize
} }
} }

View file

@ -211,7 +211,7 @@ function Grid(element, options, methods) {
tbody = $(s + "</tbody>").appendTo(table); tbody = $(s + "</tbody>").appendTo(table);
tbody.find('td').click(dayClick); tbody.find('td').click(dayClick);
segmentContainer = $("<div/>").appendTo(element); // style='position:absolute;top:0;left:0' // made it a little slower for some reason segmentContainer = $("<div style='position:absolute;top:0;left:0'/>").appendTo(element);
}else{ // NOT first time, reuse as many cells as possible }else{ // NOT first time, reuse as many cells as possible

View file

@ -188,7 +188,9 @@ $.fn.fullCalendar = function(options) {
if (v != viewName) { if (v != viewName) {
ignoreWindowResize++; ignoreWindowResize++;
var oldView = view; var oldView = view,
newViewElement;
if (oldView) { if (oldView) {
if (oldView.eventsChanged) { if (oldView.eventsChanged) {
eventsDirty(); eventsDirty();
@ -206,8 +208,9 @@ $.fn.fullCalendar = function(options) {
} }
}else{ }else{
view = viewInstances[v] = $.fullCalendar.views[v]( view = viewInstances[v] = $.fullCalendar.views[v](
$("<div class='fc-view fc-view-" + v + "' style='position:relative'/>").appendTo(content), newViewElement = $("<div class='fc-view fc-view-" + v + "' style='position:absolute'/>").appendTo(content),
options); options
);
} }
if (header) { if (header) {
@ -218,6 +221,9 @@ $.fn.fullCalendar = function(options) {
view.name = viewName = v; view.name = viewName = v;
render(); render();
if (newViewElement) {
newViewElement.css('position', 'relative');
}
if (oldView) { if (oldView) {
content.css('overflow', ''); // needs to be first content.css('overflow', ''); // needs to be first
setMinHeight(content, 0); setMinHeight(content, 0);