highlight the current view

This commit is contained in:
Georg Ehrke 2012-01-15 00:06:26 +01:00
parent 0ac9e56da9
commit b1433119cc
2 changed files with 26 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
@ -345,6 +345,11 @@ Calendar={
}
},
reseticonhighlight: function(){
$('#oneweekview_radio').css('color', '#000000');
$('#onemonthview_radio').css('color', '#000000');
$('#listview_radio').css('color', '#000000');
},
Calendar:{
overview:function(){
if($('#choosecalendar_dialog').dialog('isOpen') == true){
@ -669,12 +674,18 @@ $(document).ready(function(){
});
$('#oneweekview_radio').click(function(){
$('#calendar_holder').fullCalendar('changeView', 'agendaWeek');
Calendar.UI.reseticonhighlight();
$('#oneweekview_radio').css('color', '#6193CF');
});
$('#onemonthview_radio').click(function(){
$('#calendar_holder').fullCalendar('changeView', 'month');
Calendar.UI.reseticonhighlight();
$('#onemonthview_radio').css('color', '#6193CF');
});
$('#listview_radio').click(function(){
$('#calendar_holder').fullCalendar('changeView', 'list');
Calendar.UI.reseticonhighlight();
$('#listview_radio').css('color', '#6193CF');
});
$('#today_input').click(function(){
$('#calendar_holder').fullCalendar('today');

View File

@ -27,6 +27,20 @@
echo '$(\'#calendar_holder\').fullCalendar(\'gotoDate\', ' . $year . ', ' . --$month . ', ' . $day . ');';
echo '$(\'#dialog_holder\').load(OC.filePath(\'calendar\', \'ajax\', \'editeventform.php\') + \'?id=\' + ' . $_['showevent'] . ' , Calendar.UI.startEventDialog);';
}
switch(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'month')){
case 'agendaWeek':
echo '$(\'#oneweekview_radio\').css(\'color\', \'#6193CF\');';
break;
case 'month':
echo '$(\'#onemonthview_radio\').css(\'color\', \'#6193CF\');';
break;
case 'list':
echo '$(\'#listview_radio\').css(\'color\', \'#6193CF\');';
break;
default:
break;
}
?>
});
</script>