Improve "feel" of dragging horizontally in week view.
authorJan Schneider <jan@horde.org>
Mon, 15 Mar 2010 16:57:48 +0000 (17:57 +0100)
committerJan Schneider <jan@horde.org>
Mon, 15 Mar 2010 16:59:09 +0000 (17:59 +0100)
kronolith/js/kronolith.js

index e2c0324..51e2286 100644 (file)
@@ -1500,9 +1500,11 @@ KronolithCore = {
                     nodrop: true,
                     parentElement: function() { return $(view == 'day' ? 'kronolithEventsDay' : 'kronolithEventsWeek' + date); },
                     snap: function(x, y) {
+console.log(x);
                         x = (view == 'week')
-                            ? Math.max(minLeft, stepX * ((Math.min(maxLeft, x) + stepX / 2) / stepX | 0))
+                            ? Math.max(minLeft, stepX * ((Math.min(maxLeft, x - (x < 0 ? stepX : 0)) + stepX / 2) / stepX | 0))
                             : 0;
+console.log(x);
                         y = Math.max(0, step * (Math.min(maxDiv, y) / step | 0));
                         return [x, y];
                     }