From c3464e455277f6918da0f283608cc884c0319211 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 17 Nov 2015 20:56:47 +0000 Subject: [PATCH] Nicer formatting in tooltip for multiple categories, and still working with single categories --- calendar/js/et2_widget_event.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index 05b04ff669..5fc9841072 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -331,10 +331,14 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], ''+this.egw().lang('End') + ':' + end var cat = et2_createWidget('select-cat',{'readonly':true},this); cat.set_value(this.options.value.category); - var cat_label = []; - cat.span.children().each(function() { - cat_label.push($j(this).text()); - }); + var cat_label = this.options.value.category.indexOf(',') <= 0 ? cat.span.text() : []; + if(typeof cat_label != 'string') + { + cat.span.children().each(function() { + cat_label.push($j(this).text()); + }); + cat_label = cat_label.join(', '); + } cat.destroy(); return '
'+ @@ -349,7 +353,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], this.options.value.description+'

'+ '

'+times+'

'+ (this.options.value.location ? '

'+this.egw().lang('Location') + ':' + this.options.value.location+'

' : '')+ - (cat_label ? '

'+this.egw().lang('Category') + ':' + cat_label.join(', ')+'

' : '')+ + (cat_label ? '

'+this.egw().lang('Category') + ':' + cat_label +'

' : '')+ '

'+this.egw().lang('Participants')+':
'+ (this.options.value.parts ? this.options.value.parts.replace("\n","
"):'')+'

'+ '
'+