(js) Fix display of ghosts when dragging events
parent
be7ee69f0f
commit
ef00885941
3
NEWS
3
NEWS
|
@ -5,7 +5,8 @@ Enhancements
|
||||||
- [web] updated Angular Material to version 1.0.6
|
- [web] updated Angular Material to version 1.0.6
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
- [web] fix missing columns in SELECT statements (PostgreSQL)
|
- [web] fixed missing columns in SELECT statements (PostgreSQL)
|
||||||
|
- [web] fixed display of ghosts when dragging events
|
||||||
|
|
||||||
3.0.2 (2016-03-04)
|
3.0.2 (2016-03-04)
|
||||||
------------------
|
------------------
|
||||||
|
|
|
@ -421,6 +421,8 @@
|
||||||
Component.$resetGhost = function() {
|
Component.$resetGhost = function() {
|
||||||
this.$ghost.pointerHandler = null;
|
this.$ghost.pointerHandler = null;
|
||||||
this.$ghost.component = null;
|
this.$ghost.component = null;
|
||||||
|
this.$ghost.startHour = null;
|
||||||
|
this.$ghost.endHour = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
component = scope.block.component;
|
component = scope.block.component;
|
||||||
dayNumber = scope.block.dayNumber;
|
dayNumber = scope.block.dayNumber;
|
||||||
blockIndex = _.findIndex(component.blocks, _.matchesProperty('dayNumber', dayNumber));
|
blockIndex = _.findIndex(component.blocks, ['dayNumber', dayNumber]);
|
||||||
isFirstBlock = (blockIndex === 0);
|
isFirstBlock = (blockIndex === 0);
|
||||||
isLastBlock = (blockIndex === component.blocks.length - 1);
|
isLastBlock = (blockIndex === component.blocks.length - 1);
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function dragStart(ev) {
|
function dragStart(ev) {
|
||||||
var block, dragMode, eventType, isHourCell, isMonthly, startDate, newData, newComponent, pointerHandler, calendarData;
|
var block, eventType, isHourCell, isMonthly, startDate, newData, newComponent, pointerHandler, calendarData;
|
||||||
|
|
||||||
isHourCell = element.hasClass('clickableHourCell');
|
isHourCell = element.hasClass('clickableHourCell');
|
||||||
isMonthly = (element[0].parentNode.tagName == 'SG-CALENDAR-MONTH-DAY') ||
|
isMonthly = (element[0].parentNode.tagName == 'SG-CALENDAR-MONTH-DAY') ||
|
||||||
|
@ -166,10 +166,9 @@
|
||||||
pointerHandler.initFromCalendar(calendarData);
|
pointerHandler.initFromCalendar(calendarData);
|
||||||
|
|
||||||
// Update Component.$ghost
|
// Update Component.$ghost
|
||||||
Component.$ghost.starthour = block.starthour;
|
|
||||||
Component.$ghost.component = block.component;
|
Component.$ghost.component = block.component;
|
||||||
|
|
||||||
$log.debug('emit calendar:dragstart ' + eventType + ' ' + dragMode);
|
$log.debug('emit calendar:dragstart ' + eventType);
|
||||||
$rootScope.$emit('calendar:dragstart');
|
$rootScope.$emit('calendar:dragstart');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,7 +265,7 @@
|
||||||
// Get the start (first quarter) from the event's first block
|
// Get the start (first quarter) from the event's first block
|
||||||
// Compute overall length
|
// Compute overall length
|
||||||
this.start = block.component.blocks[0].start;
|
this.start = block.component.blocks[0].start;
|
||||||
this.duration = _.sum(block.component.blocks, function(b) {
|
this.duration = _.sumBy(block.component.blocks, function(b) {
|
||||||
return b.length;
|
return b.length;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue