(js) Display event ghost block start/end hours

This commit is contained in:
Francis Lachapelle
2016-01-21 20:46:04 -05:00
parent 54100c1f78
commit f1873edf21
5 changed files with 11 additions and 11 deletions
@@ -86,7 +86,7 @@
/**
* @ngInject
*/
stateEventsBlocks.$inject = ['$stateParams', 'Component', 'Calendar', ];
stateEventsBlocks.$inject = ['$stateParams', 'Component', 'Calendar'];
function stateEventsBlocks($stateParams, Component, Calendar) {
// See CalendarController.js
return Component.$eventsBlocksForView($stateParams.view, $stateParams.day.asDate())
@@ -55,6 +55,8 @@
' </div>',
' </div>',
' </div>',
' <div class="ghostStartHour" ng-if="block.startHour">{{ block.startHour }}</div>',
' <div class="ghostEndHour" ng-if="block.endHour">{{ block.endHour }}</div>',
'</div>'
].join(''),
link: link
@@ -103,9 +103,6 @@
if (duration > maxDuration)
duration = maxDuration;
delete scope.startHour;
delete scope.endHour;
if (currentDay > -1 && // pointer is inside viewport
((calendarNumber < 0 && // day is not associated to a calendar
currentDay == calendarDayCtrl.dayNumber) || // pointer is inside ghost's day
@@ -118,7 +115,7 @@
showGhost = true;
if (!isRelative) {
// Show start hour and set the vertical position
scope.startHour = getStartTime(start);
scope.block.startHour = getStartTime(start);
wasOtherBlock = parseInt(iElement.css('top')) === 0;
if (wasOtherBlock)
iElement.addClass('sg-event--notransition');
@@ -176,7 +173,7 @@
}
else {
// Set the end date
scope.endHour = getEndTime(start, duration);
scope.block.endHour = getEndTime(start, duration);
}
}
}
@@ -133,7 +133,7 @@
newData = {
type: 'appointment',
pid: calendarData? calendarData.pid : Calendar.$defaultCalendar(),
summary: l('New Event'),
//summary: l('New Event'),
startDate: startDate,
isAllDay: isHourCell? 0 : 1
};
@@ -366,13 +366,14 @@ $block_radius: 3px;
.ghostStartHour,
.ghostEndHour {
position: absolute;
width: 100%;
vertical-align: baseline;
color: $colorGrey900;
font-weight: $sg-font-light;
height: 14px;
left: 0px;
color: #222;
position: absolute;
text-align: center;
vertical-align: baseline;
width: 100%;
}
.ghostStartHour {