summaryrefslogtreecommitdiffstats
path: root/apps/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'apps/calendar')
-rw-r--r--apps/calendar/js/calendar.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index 604f7d2668c..2917d9f9134 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -454,6 +454,43 @@ Calendar={
});
}
},
+ initscroll:function(){
+ if(window.addEventListener)
+ document.addEventListener('DOMMouseScroll', Calendar.UI.scrollcalendar);
+ //}else{
+ document.onmousewheel = Calendar.UI.scrollcalendar;
+ //}
+ },
+ scrollcalendar:function(event){
+ var direction;
+ if(event.detail){
+ if(event.detail < 0){
+ direction = "top";
+ }else{
+ direction = "down";
+ }
+ }
+ if (event.wheelDelta){
+ if(event.wheelDelta > 0){
+ direction = "top";
+ }else{
+ direction = "down";
+ }
+ }
+ if(Calendar.UI.currentview == "onemonthview"){
+ if(direction == "down"){
+ Calendar.UI.updateDate("forward");
+ }else{
+ Calendar.UI.updateDate("backward");
+ }
+ }else if(Calendar.UI.currentview == "oneweekview"){
+ if(direction == "down"){
+ Calendar.UI.updateDate("forward");
+ }else{
+ Calendar.UI.updateDate("backward");
+ }
+ }
+ },
Calendar:{
overview:function(){
if($('#choosecalendar_dialog').dialog('isOpen') == true){
@@ -936,6 +973,7 @@ Calendar={
$(document).ready(function(){
$('#listview #more_before').click(Calendar.UI.List.renderMoreBefore);
$('#listview #more_after').click(Calendar.UI.List.renderMoreAfter);
+ Calendar.UI.initscroll();
});
//event vars
Calendar.UI.loadEvents();