Some layout fixes

- fix hidden toolbar in Safari
- fix name label shown at wrong times when switching between views & single / multi user
- better handling of not set start / end times for planner to avoid loading everything
This commit is contained in:
Nathan Gray 2016-01-26 22:17:51 +00:00
parent a0c1d29111
commit f30cbdeb9e
5 changed files with 19 additions and 16 deletions

View File

@ -2191,7 +2191,7 @@ app.classes.calendar = AppJS.extend(
w.set_width($j(view.etemplates[0].DOMContainer).width() * 0.69); w.set_width($j(view.etemplates[0].DOMContainer).width() * 0.69);
},this,et2_calendar_timegrid); },this,et2_calendar_timegrid);
$j(view.etemplates[1].DOMContainer).css({"left":"69%", "height":$j(framework.tabsUi.activeTab.contentDiv).height()+'px'}); $j(view.etemplates[1].DOMContainer).css({"left":"69%", "height":($j(framework.tabsUi.activeTab.contentDiv).height()-30)+'px'});
// TODO: Maybe some caching here // TODO: Maybe some caching here
this.egw.jsonq('calendar_uiviews::ajax_get_todos', [state.state.date, state.state.owner[0]], function(data) { this.egw.jsonq('calendar_uiviews::ajax_get_todos', [state.state.date, state.state.owner[0]], function(data) {
this.getWidgetById('label').set_value(data.label||''); this.getWidgetById('label').set_value(data.label||'');

View File

@ -698,6 +698,9 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
// Busy // Busy
if(!this.doInvalidate) return; if(!this.doInvalidate) return;
// Not yet ready
if(!this.options.start_date || !this.options.end_date) return;
// Wait a bit to see if anything else changes, then re-draw the days // Wait a bit to see if anything else changes, then re-draw the days
if(this.update_timer !== null) if(this.update_timer !== null)
{ {

View File

@ -1397,7 +1397,11 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
// If it's a short label (eg week number), don't give it an extra line // 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 // but is empty, but give extra space for a single owner name
this.div.toggleClass('calendar_TimeGridNoLabel', label.trim().length < 6 && typeof this.options.owner === 'object'); this.div.toggleClass(
'calendar_TimeGridNoLabel',
label.trim().length > 0 && label.trim().length < 6 ||
this.options.owner.length > 1
);
}, },
/** /**

View File

@ -134,7 +134,7 @@ var et2_calendar_view = et2_valueWidget.extend(
{ {
if(!new_date || new_date === null) if(!new_date || new_date === null)
{ {
throw exception('Invalid start date. ' + new_date.toString()); new_date = new Date();
} }
// Use date widget's existing functions to deal // Use date widget's existing functions to deal
@ -174,7 +174,7 @@ var et2_calendar_view = et2_valueWidget.extend(
{ {
if(!new_date || new_date === null) if(!new_date || new_date === null)
{ {
throw exception('Invalid end date. ' + new_date.toString()); new_date = new Date();
} }
// Use date widget's existing functions to deal // Use date widget's existing functions to deal
if(typeof new_date === "object" || typeof new_date === "string" && new_date.length > 8) if(typeof new_date === "object" || typeof new_date === "string" && new_date.length > 8)

View File

@ -71,22 +71,18 @@
} }
/* Space for toolbar */ /* Space for toolbar */
#calendar-view, #calendar-todo, #calendar-planner { #calendar-view, #calendar-todo, #calendar-planner, #calendar-list {
margin-top: -30px; position: absolute;
} left: 0px;
#calendar-list { right: 0px;
margin-top: -55px;
}
#calendar-planner .calendar_plannerWidget {
top: 30px;
} }
#calendar-todo { #calendar-todo {
position: absolute; position: absolute;
width: 30%; width: 30%;
margin-top: 0px; margin-top: 0px;/* Nice transition when changing days in a week */
/* Nice transition when changing days in a week */
transition: 1s ease-in-out; transition: 1s ease-in-out;
z-index: 10;
} }
#calendar-view { #calendar-view {