diff --git a/calendar/js/app.js b/calendar/js/app.js index f4d7ab7014..8d7a1634dd 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -1498,7 +1498,7 @@ app.classes.calendar = AppJS.extend( id: ""+date.getUTCFullYear() + sprintf("%02d",date.getUTCMonth()) + sprintf("%02d",date.getUTCDate()), start_date: date, end_date: end, - owner: state.state.owner[owner] || 0 + owner: grid_count > 1 ? state.state.owner[owner] || 0 : state.state.owner }); } break; @@ -1871,7 +1871,7 @@ app.classes.calendar = AppJS.extend( // Determine if we're showing multiple owners seperate or consolidated var seperate_owners = false; - var last_owner = value[0].owner; + var last_owner = value.length ? value[0].owner || 0 : 0; for(var i = 0; i < value.length && !seperate_owners; i++) { seperate_owners = seperate_owners || (last_owner !== value[i].owner) @@ -2584,7 +2584,7 @@ jQuery.extend(app.classes.calendar,{ return d; }, granularity: function(state) { - return 120; + return (state.owner.length || 1) * app.calendar.View.granularity.call(this, state); } }), month: app.classes.calendar.prototype.View.extend({ diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index d4a01b574d..5cfbead835 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -104,7 +104,8 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz // Main container this.div = $j(document.createElement("div")) - .addClass("calendar_calTimeGrid"); + .addClass("calendar_calTimeGrid") + .addClass("calendar_TimeGridNoLabel"); // Contains times / rows this.gridHeader = $j(document.createElement("div")) @@ -1013,7 +1014,8 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz { var old = this.options.owner || 0; this.owner.set_label(''); - + this.div.removeClass('calendar_TimeGridNoLabel'); + if(typeof _owner == 'string' && isNaN(_owner)) { switch(_owner[0]) @@ -1023,6 +1025,9 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz this.owner.set_value(_owner.substr(1)); break; } + + // Label is empty, but give extra space for the owner name + this.div.removeClass('calendar_TimeGridNoLabel'); } else if (typeof _owner == 'object' && _owner.length) { @@ -1061,6 +1066,12 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz { this.options.label = label; this.gridHeader.text(label); + +debugger; + // If it's a short label (eg week number), don't give it an extra line + // but is empty, but give extra space for a single owner name + this.div.removeClass('calendar_TimeGridNoLabel'); + this.div.toggleClass('calendar_TimeGridNoLabel', label.trim().length < 6 && typeof this.options.owner === 'object'); }, /** diff --git a/calendar/templates/default/app.css b/calendar/templates/default/app.css index f2d79870d0..1e2533b601 100644 --- a/calendar/templates/default/app.css +++ b/calendar/templates/default/app.css @@ -142,6 +142,14 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget */ } +.calendar_calTimeGrid.calendar_TimeGridNoLabel > .calendar_calDayCols { + top: 0em; +} + +.calendar_calTimeGrid.calendar_TimeGridNoLabel > .calendar_calGridHeader { + top: 0em; +} + /* single row in the time-line, always used in conjunction with row_{on|off}, you dont need to set a bgcolor, but you can */ .calendar_calTimeRow { @@ -170,7 +178,7 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget */ .calendar_calDayCols,.calendar_calDayCols12h,.calendar_calDayColsNoGrid{ position: absolute; - top: 0px; + top: 2em; /* bottom: 0px; does NOT work in IE, IE needs height: 100%! */ height: 100%; left: 45px; diff --git a/calendar/templates/pixelegg/app.css b/calendar/templates/pixelegg/app.css index 123ce35d9d..fe1b01cbb7 100755 --- a/calendar/templates/pixelegg/app.css +++ b/calendar/templates/pixelegg/app.css @@ -11,7 +11,7 @@ * @package calendar * @version $Id$ */ -/* $Id: app.css 53347 2015-08-11 15:35:54Z nathangray $ */ +/* $Id: app.css 53459 2015-08-24 17:28:19Z nathangray $ */ /*Media print classes*/ @media print { .th td, @@ -156,6 +156,12 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget * height: */ } +.calendar_calTimeGrid.calendar_TimeGridNoLabel > .calendar_calDayCols { + top: 0em; +} +.calendar_calTimeGrid.calendar_TimeGridNoLabel > .calendar_calGridHeader { + top: 0em; +} /* single row in the time-line, always used in conjunction with row_{on|off}, you dont need to set a bgcolor, but you can */ .calendar_calTimeRow { @@ -184,7 +190,7 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget .calendar_calDayCols12h, .calendar_calDayColsNoGrid { position: absolute; - top: 0px; + top: 2em; /* bottom: 0px; does NOT work in IE, IE needs height: 100%! */ height: 100%; left: 45px;