]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix scrolling calendar
authorBart Visscher <bartv@thisnet.nl>
Tue, 25 Oct 2011 17:56:57 +0000 (19:56 +0200)
committerBart Visscher <bartv@thisnet.nl>
Tue, 25 Oct 2011 17:56:57 +0000 (19:56 +0200)
apps/calendar/js/calendar.js

index afbb1b28586a6a7f8113aa4612acbaf4ebac6019..d63b9df36f3b10c41868af74cf4c8126b8d19ee0 100644 (file)
@@ -204,9 +204,12 @@ Calendar={
                                        direction = 'down';
                                }
                        }
-                       if(direction == 'down'){
+                       var scroll = $(document).scrollTop(),
+                               doc_height = $(document).height(),
+                               win_height = $(window).height();
+                       if(direction == 'down' && win_height == (doc_height - scroll)){
                                $('#calendar_holder').fullCalendar('next');
-                       }else{
+                       }else if (direction == 'top' && scroll == 0) {
                                $('#calendar_holder').fullCalendar('prev');
                        }
                },
@@ -483,7 +486,7 @@ function ListView(element, calendar) {
        }
 }
 $(document).ready(function(){
-       //Calendar.UI.initScroll();
+       Calendar.UI.initScroll();
        $('#calendar_holder').fullCalendar({
                header: false,
                firstDay: 1,