Implement sync button which reloads the current month
authorJoey Schulze <joey@infodrom.org>
Sat, 8 Jun 2019 14:22:45 +0000 (16:22 +0200)
committerJoey Schulze <joey@infodrom.org>
Sat, 8 Jun 2019 14:22:45 +0000 (16:22 +0200)
src/Infodrom/calendar/index.wml

index e7e2ca7..3448505 100644 (file)
@@ -259,9 +259,11 @@ function menu_close()
 function dom_enhance()
 {
     var html = ['<div class="view">',
-               '<button id="prev" style="display:none;">&lt;&lt;</button>',
+               '<button id="prev" style="display:none;"><img src="'+site_url('pix/left.png')+'" /></button>',
                '&nbsp;&nbsp;',
-               '<button id="next" style="display:none;">&gt;&gt;</button>',
+               '<button id="sync" style="display:none;"><img src="'+site_url('pix/sync.png')+'" /></button>',
+               '&nbsp;&nbsp;',
+               '<button id="next" style="display:none;"><img src="'+site_url('pix/right.png')+'" /></button>',
                '&nbsp;&nbsp;',
                '<select id="month" style="display:none;">',
                '<option value="">jetzt</option>',
@@ -390,14 +392,17 @@ $(function(){
 
     });
     $('div.view button').click(function(e){
+       var direction = null
+       if ($(this).attr('id') != 'sync')
+           direction = $(this).attr('id') == 'prev' ? 'prev' : 'next';
        if ($('#view').val() == 'bimonth') {
            $.invoke('Calendar/BiMonth',
                     {month: $('#thismonth').val(),
-                     direction: $(this).attr('id') == 'prev' ? 'prev' : 'next'}, month_actions);
+                     direction: direction}, month_actions);
        } else if ($('#view').val() == 'month') {
            $.invoke('Calendar/Month',
                     {month: $('#thismonth').val(),
-                     direction: $(this).attr('id') == 'prev' ? 'prev' : 'next'}, month_actions);
+                     direction: direction}, month_actions);
        }
     });
     if (document.location.href.indexOf('month=normal') == -1) {