brOOper / gwt-cal

Automatically exported from code.google.com/p/gwt-cal
0 stars 0 forks source link

Missing scrollToHour call in DayView.java #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
The scrollToHour setting is not taken into account by DayView, the
following modification did the trick for me:

Index:
branches/version-0.9/gwt-cal/src/main/java/com/bradrydzewski/gwt/calendar/client
/dayview/DayView.java
===================================================================

---
branches/version-0.9/gwt-cal/src/main/java/com/bradrydzewski/gwt/calendar/client
/dayview/DayView.java
(révision 225)
+++
branches/version-0.9/gwt-cal/src/main/java/com/bradrydzewski/gwt/calendar/client
/dayview/DayView.java
(copie de travail)
@@ -137,6 +137,8 @@
            appointmentWidgets.add(panel);
             this.multiViewBody.grid.add(panel);
         }
+
+        scrollToHour(getSettings().getScrollToHour());
    }

    @Override

Original issue reported on code.google.com by bertrand...@gmail.com on 28 Dec 2009 at 12:52

GoogleCodeExporter commented 9 years ago
you are right - when the dayView is initialized it doesn't take the 
CalendarSettings.scrollToHour into 
account.

i'm not sure we want to call scrollToHour in doLayout. The doLayout method is 
called when appointments are 
deleted, updated (when drag drop is enabled). This may cause an undesired 
behavior - like a user deletes an 
appointment at 11pm, and then the calendar scrolls back to 6am.

i'm thinking we call scrollToHour in the attach method. The attach method is 
called every time the 
calendar.setView(CalendarViews.DAY) method is called. I made the change in r226.

Original comment by Brad.Ryd...@gmail.com on 29 Dec 2009 at 9:00

GoogleCodeExporter commented 9 years ago
Works for me, thanks for the fix.

Original comment by bertrand...@gmail.com on 4 Jan 2010 at 3:18

GoogleCodeExporter commented 9 years ago

Original comment by Brad.Ryd...@gmail.com on 15 Feb 2010 at 5:03

GoogleCodeExporter commented 9 years ago

Original comment by Brad.Ryd...@gmail.com on 12 May 2010 at 7:10