summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2015-01-30 17:46:07 +0200
committerVaadin Code Review <review@vaadin.com>2015-02-06 11:04:38 +0000
commit20ff39aab17bd04c6d7e94c355593fe53e70ce88 (patch)
tree0494287d9f3a061bdfb4921b8ea96268043d87be /client
parentca435cd30b6bdf1a24636e37c10a43545804991f (diff)
downloadvaadin-framework-20ff39aab17bd04c6d7e94c355593fe53e70ce88.tar.gz
vaadin-framework-20ff39aab17bd04c6d7e94c355593fe53e70ce88.zip
Enable navigation on a readonly Calendar. (#16523)
- Month view: navigate to week and day views - Week view: navigate to day view and to next and prev weeks - Day view: navigate to next and prev days - Month view: hidden events can be expanded to view. Change-Id: I19c64ae64c55b8e07be7f73be64e18e700f849b5
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/calendar/CalendarConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java2
-rw-r--r--client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java32
3 files changed, 18 insertions, 22 deletions
diff --git a/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java b/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java
index e9bbf2015c..58cc31a580 100644
--- a/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java
+++ b/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java
@@ -35,8 +35,8 @@ import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.Paintable;
import com.vaadin.client.TooltipInfo;
import com.vaadin.client.UIDL;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.VConsole;
+import com.vaadin.client.WidgetUtil;
import com.vaadin.client.communication.RpcProxy;
import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.client.ui.AbstractComponentConnector;
@@ -138,7 +138,7 @@ public class CalendarConnector extends AbstractComponentConnector implements
getWidget().setListener(new DateClickListener() {
@Override
public void dateClick(String date) {
- if (!getWidget().isDisabledOrReadOnly()
+ if (!getWidget().isDisabled()
&& hasEventListener(CalendarEventId.DATECLICK)) {
rpc.dateClick(date);
}
@@ -171,7 +171,7 @@ public class CalendarConnector extends AbstractComponentConnector implements
getWidget().setListener(new WeekClickListener() {
@Override
public void weekClick(String event) {
- if (!getWidget().isDisabledOrReadOnly()
+ if (!getWidget().isDisabled()
&& hasEventListener(CalendarEventId.WEEKCLICK)) {
rpc.weekClick(event);
}
diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java b/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java
index db3f47dfed..10ed5bb3f9 100644
--- a/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java
+++ b/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java
@@ -134,7 +134,7 @@ public class DayToolbar extends HorizontalPanel implements ClickHandler {
@Override
public void onClick(ClickEvent event) {
- if (!calendar.isDisabledOrReadOnly()) {
+ if (!calendar.isDisabled()) {
if (event.getSource() == nextLabel) {
if (calendar.getForwardListener() != null) {
calendar.getForwardListener().forward();
diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java
index 424531ee58..3bf6930933 100644
--- a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java
+++ b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java
@@ -439,24 +439,20 @@ public class SimpleDayCell extends FocusableFlowPanel implements
if (calendar.isEventMoveAllowed()) {
startCalendarEventDrag(event, (MonthEventLabel) w);
}
- } else if (!calendar.isReadOnly()) {
- // these are not allowed when in read-only
- if (w == bottomspacer) {
- if (scrollable) {
- setLimitedCellHeight();
- } else {
- setUnlimitedCellHeight();
- }
- reDraw(true);
-
- } else if (w == this && !scrollable) {
- MonthGrid grid = getMonthGrid();
- if (grid.isEnabled() && calendar.isRangeSelectAllowed()) {
- grid.setSelectionStart(this);
- grid.setSelectionEnd(this);
- }
- } else if (w instanceof Label) {
- labelMouseDown = true;
+ } else if (w == bottomspacer) {
+ if (scrollable) {
+ setLimitedCellHeight();
+ } else {
+ setUnlimitedCellHeight();
+ }
+ reDraw(true);
+ } else if (w instanceof Label) {
+ labelMouseDown = true;
+ } else if (w == this && !scrollable) {
+ MonthGrid grid = getMonthGrid();
+ if (grid.isEnabled() && calendar.isRangeSelectAllowed()) {
+ grid.setSelectionStart(this);
+ grid.setSelectionEnd(this);
}
}