Calendar UI roundup
This commit is contained in:
parent
1d3b5c642a
commit
712bffc9cb
5 changed files with 30 additions and 13 deletions
|
@ -699,6 +699,9 @@ function rcube_calendar(settings)
|
|||
var fc = $(fcselector);
|
||||
var sources = [];
|
||||
|
||||
if (this._search_message)
|
||||
rcmail.hide_message(this._search_message);
|
||||
|
||||
for (var sid in this.calendars) {
|
||||
if (this.calendars[sid] && this.calendars[sid].active) {
|
||||
fc.fullCalendar('removeEventSource', this.calendars[sid]);
|
||||
|
@ -740,6 +743,10 @@ function rcube_calendar(settings)
|
|||
this.reset_quicksearch = function()
|
||||
{
|
||||
$(rcmail.gui_objects.qsearchbox).val('');
|
||||
|
||||
if (this._search_message)
|
||||
rcmail.hide_message(this._search_message);
|
||||
|
||||
if (this.search_request) {
|
||||
// restore original event sources and view mode from fullcalendar
|
||||
var fc = $(fcselector);
|
||||
|
@ -755,6 +762,13 @@ function rcube_calendar(settings)
|
|||
this.search_request = this.search_source = null;
|
||||
}
|
||||
};
|
||||
|
||||
// callback if all sources have been fetched from server
|
||||
this.events_loaded = function(count)
|
||||
{
|
||||
if (this.search_request && !count)
|
||||
this._search_message = rcmail.display_message(rcmail.gettext('searchnoresults', 'calendar'), 'notice');
|
||||
}
|
||||
|
||||
|
||||
/*** startup code ***/
|
||||
|
@ -826,7 +840,7 @@ function rcube_calendar(settings)
|
|||
},
|
||||
aspectRatio: 1,
|
||||
ignoreTimezone: false, // will translate event dates to the client's timezone
|
||||
height: $(window).height() - 96,
|
||||
height: $('#main').height(),
|
||||
eventSources: event_sources,
|
||||
monthNames : settings['months'],
|
||||
monthNamesShort : settings['months_short'],
|
||||
|
@ -868,8 +882,11 @@ function rcube_calendar(settings)
|
|||
},
|
||||
selectable: true,
|
||||
selectHelper: true,
|
||||
loading : function(isLoading) {
|
||||
loading: function(isLoading) {
|
||||
this._rc_loading = rcmail.set_busy(isLoading, 'loading', this._rc_loading);
|
||||
// trigger callback
|
||||
if (!isLoading && me.search_request)
|
||||
me.events_loaded($(this).fullCalendar('clientEvents').length);
|
||||
},
|
||||
// event rendering
|
||||
eventRender: function(event, element, view) {
|
||||
|
@ -1143,7 +1160,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
var cal = new rcube_calendar(rcmail.env.calendar_settings);
|
||||
|
||||
$(window).resize(function() {
|
||||
$('#calendar').fullCalendar('option', 'height', $(window).height() - 96);
|
||||
$('#calendar').fullCalendar('option', 'height', $('#main').height());
|
||||
}).resize();
|
||||
|
||||
// show toolbar
|
||||
|
|
|
@ -97,6 +97,7 @@ $labels['errorsaving'] = "Failed to save changes";
|
|||
$labels['operationfailed'] = "The requested operation failed";
|
||||
$labels['invalideventdates'] = "Invalid dates entered! Please check your input.";
|
||||
$labels['invalidcalendarproperties'] = "Invalid calendar properties! Please set a valid name.";
|
||||
$labels['searchnoresults'] = 'No events found in the selected calendars';
|
||||
|
||||
// recurrence form
|
||||
$labels['repeat'] = 'Repeat';
|
||||
|
|
|
@ -11,7 +11,7 @@ body.calendarmain {
|
|||
#main {
|
||||
position: absolute;
|
||||
clear: both;
|
||||
top: 85px;
|
||||
top: 90px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 10px;
|
||||
|
@ -41,7 +41,7 @@ body.calendarmain {
|
|||
|
||||
#sidebartoggle {
|
||||
position: absolute;
|
||||
left: 246px;
|
||||
left: 244px;
|
||||
width: 8px;
|
||||
top: 37px;
|
||||
bottom: 0;
|
||||
|
@ -60,7 +60,7 @@ div.sidebarclosed {
|
|||
#calendar {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 260px;
|
||||
left: 256px;
|
||||
right: 10px;
|
||||
bottom: 0;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ pre {
|
|||
|
||||
#calendars {
|
||||
position: absolute;
|
||||
top: 230px;
|
||||
top: 220px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
|
@ -149,7 +149,7 @@ pre {
|
|||
#calendartoolbar {
|
||||
position: absolute;
|
||||
top: 45px;
|
||||
left: 260px;
|
||||
left: 256px;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
|
|
|
@ -630,11 +630,10 @@ table.fc-border-separate {
|
|||
border-width: 0;
|
||||
border-bottom-width: 1px;
|
||||
padding: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc-view-table td.fc-list-header {
|
||||
_border-top-width: 1px;
|
||||
.fc-view-table .fc-list-smart td.fc-list-header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fc-view-table .fc-first td.fc-list-header {
|
||||
|
|
|
@ -218,13 +218,13 @@ $(document).ready(function(e){
|
|||
|
||||
if ($sidebar.is(':visible')) {
|
||||
$sidebar.animate({ left:'-'+(width+10)+'px' }, time, function(){ $('#sidebar').hide(); });
|
||||
$(this).animate({ left:'6px'}, time, function(){ $('#sidebartoggle').addClass('sidebarclosed') });
|
||||
$(this).animate({ left:'8px'}, time, function(){ $('#sidebartoggle').addClass('sidebarclosed') });
|
||||
$('#calendar').animate({ left:'20px'}, time, function(){ $(this).fullCalendar('render'); });
|
||||
}
|
||||
else {
|
||||
$sidebar.show().animate({ left:'10px' }, time);
|
||||
$(this).animate({ left:offset+'px'}, time, function(){ $('#sidebartoggle').removeClass('sidebarclosed'); });
|
||||
$('#calendar').animate({ left:(width+20)+'px'}, time, function(){ $(this).fullCalendar('render'); });
|
||||
$('#calendar').animate({ left:(width+16)+'px'}, time, function(){ $(this).fullCalendar('render'); });
|
||||
}
|
||||
})
|
||||
.data('offset', $('#sidebartoggle').position().left)
|
||||
|
|
Loading…
Add table
Reference in a new issue