Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

Commit

Permalink
feat(dayView): add edit and delete actions to day view events
Browse files Browse the repository at this point in the history
Closes #351
  • Loading branch information
Matt Lewis committed Jun 26, 2016
1 parent 12d99a2 commit 08c4292
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/directives/mwlCalendarDay.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ angular
dayViewStart: '=',
dayViewEnd: '=',
dayViewSplit: '=',
dayViewEventChunkSize: '='
dayViewEventChunkSize: '=',
onEditEventClick: '=',
onDeleteEventClick: '=',
editEventHtml: '=',
deleteEventHtml: '='
},
controller: 'MwlCalendarDayCtrl as vm',
bindToController: true
Expand Down
4 changes: 4 additions & 0 deletions src/templates/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
day-view-end="vm.dayViewEnd"
day-view-split="vm.dayViewSplit"
day-view-event-chunk-size="vm.dayViewEventChunkSize"
on-edit-event-click="vm.onEditEventClick"
on-delete-event-click="vm.onDeleteEventClick"
edit-event-html="vm.editEventHtml"
delete-event-html="vm.deleteEventHtml"
ng-switch-when="day">
</mwl-calendar-day>
</div>
16 changes: 16 additions & 0 deletions src/templates/calendarDayView.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@
<span ng-bind-html="vm.$sce.trustAsHtml(event.title) | calendarTruncateEventTitle:20:event.height"></span>
</a>

<a
href="javascript:;"
class="event-item-edit"
ng-if="vm.editEventHtml && event.editable !== false"
ng-bind-html="vm.$sce.trustAsHtml(vm.editEventHtml)"
ng-click="vm.onEditEventClick({calendarEvent: event})">
</a>

<a
href="javascript:;"
class="event-item-delete"
ng-if="vm.deleteEventHtml && event.deletable !== false"
ng-bind-html="vm.$sce.trustAsHtml(vm.deleteEventHtml)"
ng-click="vm.onDeleteEventClick({calendarEvent: event})">
</a>

</div>

</div>
Expand Down

0 comments on commit 08c4292

Please sign in to comment.