summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-08-24 11:59:51 +0300
committerVaadin Code Review <review@vaadin.com>2014-08-29 13:01:37 +0000
commit233c8920b7c549591dd2a7e4850d3827d7920dc0 (patch)
treed077b66cae1e120a3efcf2aff94587ce8b235c56 /client
parent604f55840dcd29c6e7a2795568a584ac622b260e (diff)
downloadvaadin-framework-233c8920b7c549591dd2a7e4850d3827d7920dc0.tar.gz
vaadin-framework-233c8920b7c549591dd2a7e4850d3827d7920dc0.zip
Update DateCellDayEvent size on updateSizes in Connector (#13233).
Change-Id: Ib3142cc62e95ce0e31bb8746eacd5ca4580c1865
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java30
1 files changed, 21 insertions, 9 deletions
diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java
index ffa5f78071..bef03707ba 100644
--- a/client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java
+++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java
@@ -18,7 +18,6 @@ package com.vaadin.client.ui.calendar.schedule;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -203,6 +202,8 @@ public class DateCell extends FocusableComplexPanel implements
width = getOffsetWidth()
- Util.measureHorizontalBorder(getElement());
+ // Update moveWidth for any DateCellDayEvent child
+ updateEventCellsWidth();
recalculateEventWidths();
} else {
removeStyleDependentName("Hsized");
@@ -221,6 +222,8 @@ public class DateCell extends FocusableComplexPanel implements
// recalc heights&size for events. all other height sizes come
// from css
startingSlotHeight = slotElements[0].getOffsetHeight();
+ // Update slotHeight for each DateCellDayEvent child
+ updateEventCellsHeight();
recalculateEventPositions();
if (isToday()) {
@@ -327,14 +330,7 @@ public class DateCell extends FocusableComplexPanel implements
.setHeight(slotElementHeights[i], Unit.PX);
}
- Iterator<Widget> it = iterator();
- while (it.hasNext()) {
- Widget child = it.next();
- if (child instanceof DateCellDayEvent) {
- ((DateCellDayEvent) child).setSlotHeightInPX(getSlotHeight());
- }
-
- }
+ updateEventCellsHeight();
}
public int getSlotHeight() {
@@ -829,4 +825,20 @@ public class DateCell extends FocusableComplexPanel implements
.contextMenu(event, DateCell.this);
}
}
+
+ private void updateEventCellsWidth() {
+ for (Widget widget : getChildren()) {
+ if (widget instanceof DateCellDayEvent) {
+ ((DateCellDayEvent) widget).setMoveWidth(width);
+ }
+ }
+ }
+
+ private void updateEventCellsHeight() {
+ for (Widget widget : getChildren()) {
+ if (widget instanceof DateCellDayEvent) {
+ ((DateCellDayEvent) widget).setSlotHeightInPX(getSlotHeight());
+ }
+ }
+ }
}