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

feat(dayView): allow the event width to be customised

Closes #494
  • Loading branch information...
Matt Lewis
Matt Lewis committed Nov 15, 2016
1 parent b99569c commit c1d9cea44d49eaa5d9dd2c165f6a5b3688b9daec
@@ -141,6 +141,7 @@ angular
dayViewEnd: '@',
dayViewSplit: '@',
dayViewEventChunkSize: '@',
dayViewEventWidth: '@',
templateScope: '=?'
},
controller: 'MwlCalendarCtrl as vm',
@@ -23,7 +23,8 @@ angular
vm.viewDate,
vm.dayViewStart,
vm.dayViewEnd,
vm.dayViewSplit
vm.dayViewSplit,
vm.dayViewEventWidth
);

vm.allDayEvents = view.allDayEvents;
@@ -101,6 +102,7 @@ angular
dayViewEnd: '=',
dayViewSplit: '=',
dayViewEventChunkSize: '=',
dayViewEventWidth: '=',
customTemplateUrls: '=?',
cellModifier: '=',
templateScope: '='
@@ -213,7 +213,7 @@ angular

}

function getDayView(events, viewDate, dayViewStart, dayViewEnd, dayViewSplit) {
function getDayView(events, viewDate, dayViewStart, dayViewEnd, dayViewSplit, dayViewEventWidth) {

var dayStart = (dayViewStart || '00:00').split(':');
var dayEnd = (dayViewEnd || '23:59').split(':');
@@ -234,7 +234,7 @@ angular
hour: dayEnd[0],
minute: dayEnd[1]
},
eventWidth: 150,
eventWidth: dayViewEventWidth ? +dayViewEventWidth : 150,
segmentHeight: 30
});

@@ -66,6 +66,7 @@
day-view-end="vm.dayViewEnd"
day-view-split="vm.dayViewSplit"
day-view-event-chunk-size="vm.dayViewEventChunkSize"
day-view-event-width="vm.dayViewEventWidth"
custom-template-urls="vm.customTemplateUrls"
cell-modifier="vm.cellModifier"
template-scope="vm.templateScope"
@@ -50,6 +50,7 @@
top: dayEvent.top - 1 + 'px',
left: dayEvent.left + 60 + 'px',
height: dayEvent.height + 'px',
width: dayEvent.width + 'px',
backgroundColor: dayEvent.event.color.secondary,
borderColor: dayEvent.event.color.primary
}"

0 comments on commit c1d9cea

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