Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix: remove deprecated edit and delete actions

BREAKING CHANGE:

`on-edit-event-click`, `on-delete-event-click`, `edit-event-html`, `delete-event-html` options have been removed in favour of generic event actions.

See the 0.22.0 changelog for migration details

Closes #417
  • Loading branch information...
Matt Lewis
Matt Lewis committed Aug 10, 2016
1 parent c53d4c8 commit fadbf750b4ba8088e00a63ab970c41819fd7b2cd
@@ -90,10 +90,6 @@ There is a single directive exposed to create the calendar, use it like so:
view-title="calendarTitle"
on-event-click="eventClicked(calendarEvent)"
on-event-times-changed="calendarEvent.startsAt = calendarNewEventStart; calendarEvent.endsAt = calendarNewEventEnd"
edit-event-html="'<i class=\'glyphicon glyphicon-pencil\'></i>'"
delete-event-html="'<i class=\'glyphicon glyphicon-remove\'></i>'"
on-edit-event-click="eventEdited(calendarEvent)"
on-delete-event-click="eventDeleted(calendarEvent)"
cell-is-open="true">
</mwl-calendar>
```
@@ -2,7 +2,6 @@

var angular = require('angular');
var LOG_PREFIX = 'Bootstrap calendar:';
var CHANGELOG_LINK = 'https://github.com/mattlewis92/angular-bootstrap-calendar/blob/master/CHANGELOG.md';

angular
.module('mwl.calendar')
@@ -33,11 +32,6 @@ angular

};

if ($attrs.onEditEventClick || $attrs.onDeleteEventClick || $attrs.editEventHtml || $attrs.deleteEventHtml) {
$log.warn(LOG_PREFIX, '`on-edit-event-click`, `on-delete-event-click`, `edit-event-html`, `delete-event-html` options ' +
'are deprecated, please see the changelog on how to upgrade: ' + CHANGELOG_LINK);
}

var previousDate = moment(vm.viewDate);
var previousView = vm.view;

@@ -130,15 +124,11 @@ angular
view: '=',
viewTitle: '=?',
viewDate: '=',
editEventHtml: '=?',
deleteEventHtml: '=?',
cellIsOpen: '=?',
slideBoxDisabled: '=?',
customTemplateUrls: '=?',
onEventClick: '&',
onEventTimesChanged: '&',
onEditEventClick: '&',
onDeleteEventClick: '&',
onTimespanClick: '&',
onDateRangeSelect: '&?',
onViewChangeClick: '&',
@@ -101,10 +101,6 @@ angular
dayViewEnd: '=',
dayViewSplit: '=',
dayViewEventChunkSize: '=',
onEditEventClick: '=',
onDeleteEventClick: '=',
editEventHtml: '=',
deleteEventHtml: '=',
customTemplateUrls: '=?',
cellModifier: '=',
templateScope: '='
@@ -136,12 +136,8 @@ angular
events: '=',
viewDate: '=',
onEventClick: '=',
onEditEventClick: '=',
onDeleteEventClick: '=',
onEventTimesChanged: '=',
onDateRangeSelect: '=',
editEventHtml: '=',
deleteEventHtml: '=',
cellIsOpen: '=',
onTimespanClick: '=',
cellModifier: '=',
@@ -35,10 +35,6 @@ angular
isOpen: '=',
events: '=',
onEventClick: '=',
editEventHtml: '=',
onEditEventClick: '=',
deleteEventHtml: '=',
onDeleteEventClick: '=',
cell: '=',
customTemplateUrls: '=?',
templateScope: '='
@@ -76,10 +76,6 @@ angular
viewDate: '=',
onEventClick: '=',
onEventTimesChanged: '=',
onEditEventClick: '=',
onDeleteEventClick: '=',
editEventHtml: '=',
deleteEventHtml: '=',
cellIsOpen: '=',
onTimespanClick: '=',
cellModifier: '=',
@@ -12,11 +12,7 @@
view-date="vm.viewDate"
on-event-click="vm.onEventClick"
on-event-times-changed="vm.onEventTimesChanged"
on-edit-event-click="vm.onEditEventClick"
on-delete-event-click="vm.onDeleteEventClick"
on-timespan-click="vm.onTimespanClick"
edit-event-html="vm.editEventHtml"
delete-event-html="vm.deleteEventHtml"
cell-is-open="vm.cellIsOpen"
cell-modifier="vm.cellModifier"
slide-box-disabled="vm.slideBoxDisabled"
@@ -30,12 +26,8 @@
view-date="vm.viewDate"
on-event-click="vm.onEventClick"
on-event-times-changed="vm.onEventTimesChanged"
on-edit-event-click="vm.onEditEventClick"
on-delete-event-click="vm.onDeleteEventClick"
on-timespan-click="vm.onTimespanClick"
on-date-range-select="vm.onDateRangeSelect"
edit-event-html="vm.editEventHtml"
delete-event-html="vm.deleteEventHtml"
cell-is-open="vm.cellIsOpen"
cell-modifier="vm.cellModifier"
slide-box-disabled="vm.slideBoxDisabled"
@@ -72,10 +64,6 @@
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"
custom-template-urls="vm.customTemplateUrls"
cell-modifier="vm.cellModifier"
template-scope="vm.templateScope"
@@ -71,22 +71,6 @@
<span ng-bind-html="vm.calendarEventTitle.dayView(dayEvent.event) | calendarTrustAsHtml"></span>
</a>

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

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

<a
href="javascript:;"
class="event-item-action"
@@ -25,10 +25,6 @@
is-open="vm.openRowIndex === $index && vm.view[vm.openDayIndex].events.length > 0 && !vm.slideBoxDisabled"
events="vm.view[vm.openDayIndex].events"
on-event-click="vm.onEventClick"
edit-event-html="vm.editEventHtml"
on-edit-event-click="vm.onEditEventClick"
delete-event-html="vm.deleteEventHtml"
on-delete-event-click="vm.onDeleteEventClick"
cell="vm.view[vm.openDayIndex]"
custom-template-urls="vm.customTemplateUrls"
template-scope="vm.templateScope">
@@ -16,22 +16,6 @@
<span ng-bind-html="isMonthView ? vm.calendarEventTitle.monthView(event) : vm.calendarEventTitle.yearView(event) | calendarTrustAsHtml"></span>
</a>

<a
href="javascript:;"
class="event-item-edit"
ng-if="vm.editEventHtml && event.editable !== false"
ng-bind-html="vm.editEventHtml | calendarTrustAsHtml"
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.deleteEventHtml | calendarTrustAsHtml"
ng-click="vm.onDeleteEventClick({calendarEvent: event})">
</a>

<a
href="javascript:;"
class="event-item-action"
@@ -37,10 +37,6 @@
is-open="vm.openRowIndex === $index && vm.view[vm.openMonthIndex].events.length > 0 && !vm.slideBoxDisabled"
events="vm.view[vm.openMonthIndex].events"
on-event-click="vm.onEventClick"
edit-event-html="vm.editEventHtml"
on-edit-event-click="vm.onEditEventClick"
delete-event-html="vm.deleteEventHtml"
on-delete-event-click="vm.onDeleteEventClick"
cell="vm.view[vm.openMonthIndex]"
custom-template-urls="vm.customTemplateUrls"
template-scope="vm.templateScope">
@@ -24,8 +24,6 @@ describe('mwlCalendar directive', function() {
'on-event-click="vm.eventClicked(calendarEvent)" ' +
'on-event-times-changed="vm.eventTimesChanged(calendarEvent); ' +
'calendarEvent.startsAt = calendarNewEventStart; calendarEvent.endsAt = calendarNewEventEnd" ' +
'on-edit-event-click="vm.eventEdited(calendarEvent)" ' +
'on-delete-event-click="vm.eventDeleted(calendarEvent)" ' +
'cell-is-open="true" ' +
'day-view-start="06:00" ' +
'day-view-end="22:59" ' +

0 comments on commit fadbf75

Please sign in to comment.
You can’t perform that action at this time.