(js) Make events clickable in month view

This commit is contained in:
Francis Lachapelle
2015-08-07 15:32:00 -04:00
parent 8ab591a1b6
commit ce8a4b6d8a
6 changed files with 34 additions and 28 deletions
@@ -28,7 +28,7 @@
},
replace: true,
template: [
'<div class="event draggable">',
'<div class="sg-event sg-draggable">',
' <div class="eventInside" ng-click="clickBlock({clickEvent: $event, clickComponent: block.component})">',
' <div class="gradient">',
' </div>',
@@ -29,10 +29,10 @@
clickBlock: '&sgClick'
},
template: [
'<sg-calendar-day-block class="event draggable"',
' ng-repeat="block in blocks[day]"',
' sg-block="block"',
' sg-click="clickBlock({event: clickEvent, component: clickComponent})"/>'
'<sg-calendar-day-block class="sg-event draggable"',
' ng-repeat="block in blocks[day]"',
' sg-block="block"',
' sg-click="clickBlock({event: clickEvent, component: clickComponent})"/>'
].join('')
};
}
@@ -14,20 +14,22 @@
<sg-calendar-monh-day
sg-blocks="calendar.blocks"
sg-day="20150408" />
sg-day="20150408"
sg-click="open({ event: clickEvent, component: clickComponent })"/>
*/
function sgCalendarMonthDay() {
return {
restrict: 'E',
scope: {
blocks: '=sgBlocks',
day: '@sgDay'
day: '@sgDay',
clickBlock: '&sgClick'
},
replace: true,
template: [
'<sg-calendar-month-event',
' ng-repeat="block in blocks[day]"',
' sg-block="block"/>'
' sg-block="block"',
' sg-click="clickBlock({event: clickEvent, component: clickComponent})"/>'
].join('')
};
}
@@ -19,21 +19,21 @@
return {
restrict: 'E',
scope: {
block: '=sgBlock'
block: '=sgBlock',
clickBlock: '&sgClick'
},
replace: true,
template: [
'<div class="sg-event">',
' <span ng-if="!block.component.c_isallday">{{ block.starthour }} - </span>',
' {{ block.component.c_title }}',
' <span class="icons">',
' <i ng-if="block.component.c_nextalarm" class="md-icon-alarm"></i>',
' <i ng-if="block.component.c_classification == 1" class="md-icon-visibility-off"></i>',
' <i ng-if="block.component.c_classification == 2" class="md-icon-vpn-key"></i>',
' </span>',
'<div class="sg-event sg-draggable" ng-click="clickBlock({clickEvent: $event, clickComponent: block.component})">',
' <span ng-if="!block.component.c_isallday">{{ block.starthour }} - </span>',
' {{ block.component.c_title }}',
' <span class="icons">',
' <i ng-if="block.component.c_nextalarm" class="md-icon-alarm"></i>',
' <i ng-if="block.component.c_classification == 1" class="md-icon-visibility-off"></i>',
' <i ng-if="block.component.c_classification == 2" class="md-icon-vpn-key"></i>',
' </span>',
' <div class="leftDragGrip"></div>',
' <div class="rightDragGrip"></div>',
' </div>',
'</div>'
].join(''),
link: link