fixed bug when dragging non-start event segment from all-day slot to timed-slot in agenda view
This commit is contained in:
parent
075df1d144
commit
6823f382e0
|
@ -354,6 +354,7 @@ function AgendaEventRenderer() {
|
|||
function draggableDayEvent(event, eventElement, isStart) {
|
||||
if (!opt('disableDragging') && eventElement.draggable) {
|
||||
var origWidth;
|
||||
var revert;
|
||||
var allDay=true;
|
||||
var dayDelta;
|
||||
var dis = opt('isRTL') ? -1 : 1;
|
||||
|
@ -370,9 +371,9 @@ function AgendaEventRenderer() {
|
|||
hideEvents(event, eventElement);
|
||||
origWidth = eventElement.width();
|
||||
hoverListener.start(function(cell, origCell, rowDelta, colDelta) {
|
||||
eventElement.draggable('option', 'revert', !cell || !rowDelta && !colDelta);
|
||||
clearOverlays();
|
||||
if (cell) {
|
||||
revert = false;
|
||||
dayDelta = colDelta * dis;
|
||||
if (!cell.row) {
|
||||
// on full-days
|
||||
|
@ -383,7 +384,8 @@ function AgendaEventRenderer() {
|
|||
resetElement();
|
||||
}else{
|
||||
// mouse is over bottom slots
|
||||
if (isStart && allDay) {
|
||||
if (isStart) {
|
||||
if (allDay) {
|
||||
// convert event to temporary slot-event
|
||||
eventElement.width(colWidth - 10); // don't use entire width
|
||||
setOuterHeight(
|
||||
|
@ -396,15 +398,29 @@ function AgendaEventRenderer() {
|
|||
eventElement.draggable('option', 'grid', [colWidth, 1]);
|
||||
allDay = false;
|
||||
}
|
||||
}else{
|
||||
revert = true;
|
||||
}
|
||||
}
|
||||
revert = revert || (allDay && !dayDelta);
|
||||
}else{
|
||||
revert = true;
|
||||
}
|
||||
eventElement.draggable('option', 'revert', revert);
|
||||
}, ev, 'drag');
|
||||
},
|
||||
stop: function(ev, ui) {
|
||||
var cell = hoverListener.stop();
|
||||
hoverListener.stop();
|
||||
clearOverlays();
|
||||
trigger('eventDragStop', eventElement, event, ev, ui);
|
||||
if (cell && (!allDay || dayDelta)) {
|
||||
if (revert) {
|
||||
// hasn't moved or is out of bounds (draggable has already reverted)
|
||||
resetElement();
|
||||
if ($.browser.msie) {
|
||||
eventElement.css('filter', ''); // clear IE opacity side-effects
|
||||
}
|
||||
showEvents(event, eventElement);
|
||||
}else{
|
||||
// changed!
|
||||
eventElement.find('a').removeAttr('href'); // prevents safari from visiting the link
|
||||
var minuteDelta = 0;
|
||||
|
@ -415,13 +431,6 @@ function AgendaEventRenderer() {
|
|||
- (event.start.getHours() * 60 + event.start.getMinutes());
|
||||
}
|
||||
eventDrop(this, event, dayDelta, minuteDelta, allDay, ev, ui);
|
||||
}else{
|
||||
// hasn't moved or is out of bounds (draggable has already reverted)
|
||||
resetElement();
|
||||
if ($.browser.msie) {
|
||||
eventElement.css('filter', ''); // clear IE opacity side-effects
|
||||
}
|
||||
showEvents(event, eventElement);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue