1
0
Fork 0

frio: stop the custom cal rendering (if no author-name exist) only for the modes agendaWeek and agendaDay

This commit is contained in:
rabuzarus 2016-10-17 22:14:12 +02:00
parent 88f1affb2f
commit 430ffb792e

View file

@ -38,38 +38,39 @@ $(document).ready(function() {
aspectRatio: 1, aspectRatio: 1,
eventRender: function(event, element, view) { eventRender: function(event, element, view) {
//console.log(view.name); //console.log(view.name);
if (event.item['author-name'] == null) return;
switch(view.name){ switch(view.name){
case "month": case "month":
element.find(".fc-title").html( element.find(".fc-title").html(
"<span class='item-desc'>{2}</span>".format( "<span class='item-desc'>{2}</span>".format(
event.item['author-avatar'], event.item['author-avatar'],
event.item['author-name'], event.item['author-name'],
event.title, event.title,
event.item.desc, event.item.desc,
event.item.location event.item.location
)); ));
break; break;
case "agendaWeek": case "agendaWeek":
element.find(".fc-title").html( if (event.item['author-name'] == null) return;
"<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format( element.find(".fc-title").html(
event.item['author-avatar'], "<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
event.item['author-name'], event.item['author-avatar'],
event.item.desc, event.item['author-name'],
formatEventLocationText(event.item.location) event.item.desc,
)); formatEventLocationText(event.item.location)
));
break; break;
case "agendaDay": case "agendaDay":
element.find(".fc-title").html( if (event.item['author-name'] == null) return;
"<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format( element.find(".fc-title").html(
event.item['author-avatar'], "<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
event.item['author-name'], event.item['author-avatar'],
event.item.desc, event.item['author-name'],
formatEventLocationText(event.item.location) event.item.desc,
)); formatEventLocationText(event.item.location)
break; ));
break;
case "listMonth": case "listMonth":
element.find(".fc-list-item-title").html(formatListViewEvent(event)); element.find(".fc-list-item-title").html(formatListViewEvent(event));
break; break;
} }
}, },