]> source.dussan.org Git - nextcloud-server.git/commitdiff
[Calendar] Use class for active view button
authorBart Visscher <bartv@thisnet.nl>
Thu, 19 Jan 2012 20:00:19 +0000 (21:00 +0100)
committerBart Visscher <bartv@thisnet.nl>
Thu, 19 Jan 2012 20:00:19 +0000 (21:00 +0100)
apps/calendar/css/style.css
apps/calendar/js/calendar.js
apps/calendar/templates/calendar.php

index 108bc647a7f3c04dd1330ba64f117b216c036220..cffaf356402d7c43f8b8811c0133e50a8c49777b 100644 (file)
@@ -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;
 }
index 4d0ca3ba650a62aff5eb93a30231239c6e021c3d..228ea97c2da0715806fbfd7c9737518bb6b3941f 100644 (file)
@@ -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');
index 929f5b72f9668c2394e5c572633e89072023ad28..2d5cdea4d740647f0fa1348b595e5b276edb645f 100755 (executable)
                                        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>