diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-01-19 21:00:19 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-01-19 21:00:19 +0100 |
commit | ccad24a925b2e610881fceba9fb550f91da24162 (patch) | |
tree | a23b9eed4a9b59395375e2d42d6c38b8ffed04d5 /apps/calendar/js | |
parent | 838766add085abab914bb405903ced35baddbb74 (diff) | |
download | nextcloud-server-ccad24a925b2e610881fceba9fb550f91da24162.tar.gz nextcloud-server-ccad24a925b2e610881fceba9fb550f91da24162.zip |
[Calendar] Use class for active view button
Diffstat (limited to 'apps/calendar/js')
-rw-r--r-- | apps/calendar/js/calendar.js | 26 |
1 files changed, 16 insertions, 10 deletions
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'); |