summaryrefslogtreecommitdiffstats
path: root/apps/calendar
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-01-19 21:00:19 +0100
committerBart Visscher <bartv@thisnet.nl>2012-01-19 21:00:19 +0100
commitccad24a925b2e610881fceba9fb550f91da24162 (patch)
treea23b9eed4a9b59395375e2d42d6c38b8ffed04d5 /apps/calendar
parent838766add085abab914bb405903ced35baddbb74 (diff)
downloadnextcloud-server-ccad24a925b2e610881fceba9fb550f91da24162.tar.gz
nextcloud-server-ccad24a925b2e610881fceba9fb550f91da24162.zip
[Calendar] Use class for active view button
Diffstat (limited to 'apps/calendar')
-rw-r--r--apps/calendar/css/style.css2
-rw-r--r--apps/calendar/js/calendar.js26
-rwxr-xr-xapps/calendar/templates/calendar.php14
3 files changed, 17 insertions, 25 deletions
diff --git a/apps/calendar/css/style.css b/apps/calendar/css/style.css
index 108bc647a7f..cffaf356402 100644
--- a/apps/calendar/css/style.css
+++ b/apps/calendar/css/style.css
@@ -43,7 +43,7 @@
.popup {display: none; position: absolute; z-index: 1000; background: #eeeeee; color: #000000; border: 1px solid #1a1a1a; font-size: 90%;}
.event_popup {width: 280px; height: 40px; padding: 10px;}
-input[type="button"].active {color: #0098E4}
+input[type="button"].active {color: #6193CF}
#fromtime, #totime {
color:#333;
}
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index 4d0ca3ba650..228ea97c2da 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -351,10 +351,21 @@ Calendar={
}
},
- reseticonhighlight: function(){
- $('#oneweekview_radio').css('color', '#000000');
- $('#onemonthview_radio').css('color', '#000000');
- $('#listview_radio').css('color', '#000000');
+ setViewActive: function(view){
+ $('#view input[type="button"]').removeClass('active');
+ var id;
+ switch (view) {
+ case 'agendaWeek':
+ id = 'oneweekview_radio';
+ break;
+ case 'month':
+ id = 'onemonthview_radio';
+ break;
+ case 'list':
+ id = 'listview_radio';
+ break;
+ }
+ $('#'+id).addClass('active');
},
Calendar:{
overview:function(){
@@ -658,6 +669,7 @@ $(document).ready(function(){
viewDisplay: function(view) {
$('#datecontrol_date').html(view.title);
$.get(OC.filePath('calendar', 'ajax', 'changeview.php') + "?v="+view.name);
+ Calendar.UI.setViewActive(view.name);
if (view.name == 'agendaWeek') {
$('#calendar_holder').fullCalendar('option', 'aspectRatio', 0.1);
}
@@ -689,18 +701,12 @@ $(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');
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index 929f5b72f96..2d5cdea4d74 100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -28,20 +28,6 @@
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>