diff --git a/README.md b/README.md index 43e4eb68..18502283 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,10 @@ An optional expression that is evaluated when the view is changed by clicking on An optional expression that is evaluated on each cell generated for the year and month views. `calendarCell` can be used in the expression and is an object containing the current cell data which you can modify (see the `calendarHelper` service source code or just console.log it to see what data is available). If you add the `cssClass` property it will be applied to the cell. +### slide-box-disabled + +If set it true it will disable the slidebox on the month and year views + ## Configuring the calendar default config You can easily customise the date formats and i18n strings used throughout the calendar by using the `calendarConfig` value. Please note that these example formats are those used by moment.js and these won't work if using angular as the date formatter. Example usage: diff --git a/docs/examples/examples.json b/docs/examples/examples.json index 9035f7ad..b3d4868a 100644 --- a/docs/examples/examples.json +++ b/docs/examples/examples.json @@ -55,4 +55,7 @@ }, { "key": "draggable-external-events", "label": "Draggable external events" +}, { + "key": "slide-box-disabled", + "label": "Disable the slidebox" }] diff --git a/docs/examples/slide-box-disabled/javascript.js b/docs/examples/slide-box-disabled/javascript.js new file mode 100644 index 00000000..0dfeb9a0 --- /dev/null +++ b/docs/examples/slide-box-disabled/javascript.js @@ -0,0 +1,25 @@ +angular + .module('mwl.calendar.docs') + .controller('SlideBoxDisabledCtrl', function(moment) { + + var vm = this; + + vm.events = [ + { + title: 'Increments the badge total on the day cell', + type: 'warning', + startsAt: moment().startOf('month').toDate(), + incrementsBadgeTotal: true + }, + { + title: 'Does not increment the badge total ', + type: 'info', + startsAt: moment().startOf('month').toDate(), + incrementsBadgeTotal: false + } + ]; + + vm.calendarView = 'month'; + vm.viewDate = moment().startOf('month').toDate(); + + }); diff --git a/docs/examples/slide-box-disabled/markup.html b/docs/examples/slide-box-disabled/markup.html new file mode 100644 index 00000000..9c59db81 --- /dev/null +++ b/docs/examples/slide-box-disabled/markup.html @@ -0,0 +1,9 @@ +
+ + + +
diff --git a/src/directives/mwlCalendar.js b/src/directives/mwlCalendar.js index 89679d3c..6f95fa4c 100644 --- a/src/directives/mwlCalendar.js +++ b/src/directives/mwlCalendar.js @@ -128,6 +128,7 @@ angular editEventHtml: '=?', deleteEventHtml: '=?', cellIsOpen: '=?', + slideBoxDisabled: '=?', onEventClick: '&', onEventTimesChanged: '&', onEditEventClick: '&', diff --git a/src/directives/mwlCalendarMonth.js b/src/directives/mwlCalendarMonth.js index b2f4bb49..f05c1ed2 100644 --- a/src/directives/mwlCalendarMonth.js +++ b/src/directives/mwlCalendarMonth.js @@ -108,7 +108,8 @@ angular deleteEventHtml: '=', cellIsOpen: '=', onTimespanClick: '=', - cellModifier: '=' + cellModifier: '=', + slideBoxDisabled: '=' }, controller: 'MwlCalendarMonthCtrl as vm', link: function(scope, element, attrs, calendarCtrl) { diff --git a/src/directives/mwlCalendarYear.js b/src/directives/mwlCalendarYear.js index 24a4529b..fd805fda 100644 --- a/src/directives/mwlCalendarYear.js +++ b/src/directives/mwlCalendarYear.js @@ -80,7 +80,8 @@ angular deleteEventHtml: '=', cellIsOpen: '=', onTimespanClick: '=', - cellModifier: '=' + cellModifier: '=', + slideBoxDisabled: '=' }, controller: 'MwlCalendarYearCtrl as vm', link: function(scope, element, attrs, calendarCtrl) { diff --git a/src/templates/calendar.html b/src/templates/calendar.html index a987902d..db0562aa 100644 --- a/src/templates/calendar.html +++ b/src/templates/calendar.html @@ -19,6 +19,7 @@ delete-event-html="vm.deleteEventHtml" cell-is-open="vm.cellIsOpen" cell-modifier="vm.cellModifier" + slide-box-disabled="vm.slideBoxDisabled" ng-switch-when="year"> @@ -34,6 +35,7 @@ delete-event-html="vm.deleteEventHtml" cell-is-open="vm.cellIsOpen" cell-modifier="vm.cellModifier" + slide-box-disabled="vm.slideBoxDisabled" ng-switch-when="month"> diff --git a/src/templates/calendarMonthCell.html b/src/templates/calendarMonthCell.html index 2d5ab3ad..d742f64e 100644 --- a/src/templates/calendarMonthCell.html +++ b/src/templates/calendarMonthCell.html @@ -24,7 +24,7 @@ ng-bind="day.label"> -
+
diff --git a/src/templates/calendarMonthView.html b/src/templates/calendarMonthView.html index 25345cdc..6b8f7e86 100644 --- a/src/templates/calendarMonthView.html +++ b/src/templates/calendarMonthView.html @@ -21,7 +21,7 @@
+ ng-show="monthIndex === vm.openMonthIndex && vm.view[vm.openMonthIndex].events.length > 0 && !vm.slideBoxDisabled"> @@ -34,7 +34,7 @@