reworked event resizable div (fixed issue 504). moved msie-dependent code from js to css

This commit is contained in:
Adam Shaw 2011-02-19 17:49:19 -08:00
parent c841be97cb
commit 325cb04690
6 changed files with 16 additions and 24 deletions

View file

@ -420,9 +420,7 @@ function AgendaEventRenderer() {
if (revert) { if (revert) {
// hasn't moved or is out of bounds (draggable has already reverted) // hasn't moved or is out of bounds (draggable has already reverted)
resetElement(); resetElement();
if ($.browser.msie) { eventElement.css('filter', ''); // clear IE opacity side-effects
eventElement.css('filter', ''); // clear IE opacity side-effects
}
showEvents(event, eventElement); showEvents(event, eventElement);
}else{ }else{
// changed! // changed!
@ -473,9 +471,6 @@ function AgendaEventRenderer() {
start: function(ev, ui) { start: function(ev, ui) {
trigger('eventDragStart', eventElement, event, ev, ui); trigger('eventDragStart', eventElement, event, ev, ui);
hideEvents(event, eventElement); hideEvents(event, eventElement);
if ($.browser.msie) {
eventElement.find('div.fc-event-bg').hide(); // nested opacities mess up in IE, just hide
}
origPosition = eventElement.position(); origPosition = eventElement.position();
minuteDelta = prevMinuteDelta = 0; minuteDelta = prevMinuteDelta = 0;
hoverListener.start(function(cell, origCell, rowDelta, colDelta) { hoverListener.start(function(cell, origCell, rowDelta, colDelta) {
@ -523,12 +518,6 @@ function AgendaEventRenderer() {
resetElement(); resetElement();
eventElement.css(origPosition); // sometimes fast drags make event revert to wrong position eventElement.css(origPosition); // sometimes fast drags make event revert to wrong position
updateTimeText(0); updateTimeText(0);
if ($.browser.msie) { // TODO: dont use browser detection. base off of the presence of filter
eventElement
.css('filter', '') // clear IE opacity side-effects
.find('div.fc-event-bg')
.show();
}
showEvents(event, eventElement); showEvents(event, eventElement);
} }
} }
@ -568,9 +557,6 @@ function AgendaEventRenderer() {
start: function(ev, ui) { start: function(ev, ui) {
slotDelta = prevSlotDelta = 0; slotDelta = prevSlotDelta = 0;
hideEvents(event, eventElement); hideEvents(event, eventElement);
if ($.browser.msie && $.browser.version == '6.0') {
eventElement.css('overflow', 'hidden');
}
eventElement.css('z-index', 9); eventElement.css('z-index', 9);
trigger('eventResizeStart', this, event, ev, ui); trigger('eventResizeStart', this, event, ev, ui);
}, },

View file

@ -708,9 +708,6 @@ function AgendaView(element, calendar, viewName) {
}, },
rect rect
)); ));
if ($.browser.msie) {
selectionHelper.find('div.fc-event-bg').hide(); // nested opacities mess up in IE, just hide
}
selectionHelper.css('opacity', opt('dragOpacity')); selectionHelper.css('opacity', opt('dragOpacity'));
} }
if (selectionHelper) { if (selectionHelper) {

View file

@ -118,6 +118,10 @@
filter: alpha(opacity=30); filter: alpha(opacity=30);
} }
.fc .ui-draggable-dragging .fc-event-bg {
display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */
}
/* resizable */ /* resizable */
.fc-event-vert .ui-resizable-s { .fc-event-vert .ui-resizable-s {
@ -132,4 +136,8 @@
cursor: s-resize; cursor: s-resize;
} }
.fc-agenda .ui-resizable-resizing { /* TODO: better selector */
_overflow: hidden;
}

View file

@ -129,9 +129,7 @@ function BasicEventRenderer() {
if (dayDelta) { if (dayDelta) {
eventDrop(this, event, dayDelta, 0, event.allDay, ev, ui); eventDrop(this, event, dayDelta, 0, event.allDay, ev, ui);
}else{ }else{
if ($.browser.msie) { eventElement.css('filter', ''); // clear IE opacity side-effects
eventElement.css('filter', ''); // clear IE opacity side-effects
}
showEvents(event, eventElement); showEvents(event, eventElement);
} }
//setOverflowHidden(false); //setOverflowHidden(false);

View file

@ -189,7 +189,9 @@ function DayEventRenderer() {
"</div>"; "</div>";
if (seg.isEnd && isEventResizable(event)) { if (seg.isEnd && isEventResizable(event)) {
html += html +=
"<div class='ui-resizable-handle ui-resizable-" + (rtl ? 'w' : 'e') + "'></div>"; "<div class='ui-resizable-handle ui-resizable-" + (rtl ? 'w' : 'e') + "'>" +
"&nbsp;&nbsp;&nbsp;" + // makes hit area a lot better for IE6/7
"</div>";
} }
html += html +=
"</" + (url ? "a" : "div" ) + ">"; "</" + (url ? "a" : "div" ) + ">";

View file

@ -177,8 +177,9 @@ a.fc-event {
display: block; display: block;
position: absolute; position: absolute;
z-index: 99999; z-index: 99999;
border: 0 !important; /* important overrides pre jquery ui 1.7 styles */ overflow: hidden; /* hacky spaces (IE6/7) */
background: url(data:image/gif;base64,AAAA) !important; /* hover fix for IE */ font-size: 300%; /* */
line-height: 50%; /* */
} }