(feat) Open events from day and week views

This commit is contained in:
Francis Lachapelle
2015-07-28 20:45:46 -04:00
parent 571be37c1d
commit e208ee3fde
4 changed files with 34 additions and 22 deletions
@@ -9,24 +9,30 @@
* @restrict element
* @param {object} sgBlocks - the events blocks definitions for the current view
* @param {string} sgDay - the day of the events to display
* @ngInject
* @param {function} sgClick - the function to call when clicking on a block.
* Two variables are available: event (the event that triggered the mouse click),
* and component (a Component object)
*
* @example:
<sg-calendar-day-table
sg-blocks="calendar.blocks"
sg-day="20150330" />
sg-day="20150330"
sg-click="open({ event: clickEvent, component: clickComponent })"/>
*/
function sgCalendarDayTable() {
return {
restrict: 'E',
scope: {
blocks: '=sgBlocks',
day: '@sgDay'
day: '@sgDay',
clickBlock: '&sgClick'
},
template: [
'<sg-calendar-day-block class="event draggable"',
' ng-repeat="block in blocks[day]"',
' sg-block="block"/>'
' sg-block="block"',
' sg-click="clickBlock({event: clickEvent, component: clickComponent})"/>'
].join('')
};
}