events js: don't modify rendered item if not autor specified

This commit is contained in:
Fabio Comuni 2012-02-14 16:28:10 +01:00
parent 22cfb77173
commit 549c920e6f

View file

@ -22,11 +22,12 @@
}, },
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-event-title").html( element.find(".fc-event-title").html(
"<img src='{0}' style='height:10px'>{1} : {2}".format( "<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
event.item['author-avatar'], event.item['author-avatar'],
event.item['author-name'], event.item['author-name'],
event.title event.title
@ -34,7 +35,7 @@
break; break;
case "agendaWeek": case "agendaWeek":
element.find(".fc-event-title").html( element.find(".fc-event-title").html(
"<img src='{0}' style='height:12px'>{1}<p>{2}</p><p>{3}</p>".format( "<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
event.item['author-avatar'], event.item['author-avatar'],
event.item['author-name'], event.item['author-name'],
event.item.desc, event.item.desc,
@ -43,7 +44,7 @@
break; break;
case "agendaDay": case "agendaDay":
element.find(".fc-event-title").html( element.find(".fc-event-title").html(
"<img src='{0}' style='height:24px'>{1}<p>{2}</p><p>{3}</p>".format( "<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
event.item['author-avatar'], event.item['author-avatar'],
event.item['author-name'], event.item['author-name'],
event.item.desc, event.item.desc,