import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
+import com.vaadin.terminal.gwt.client.ui.TouchScrollDelegate.TouchScrollHandler;
public class VPanel extends SimplePanel implements Container,
ShortcutActionHandlerOwner, Focusable {
private String previousStyleName;
+ private final TouchScrollHandler touchScrollHandler;
+
private ClickEventHandler clickEventHandler = new ClickEventHandler(this,
CLICK_EVENT_IDENTIFIER) {
contentNode.getStyle().setProperty("position", "relative");
getElement().getStyle().setProperty("overflow", "hidden");
- TouchScrollDelegate.enableTouchScrolling(this, contentNode);
+ touchScrollHandler = TouchScrollDelegate.enableTouchScrolling(this,
+ contentNode);
}
/**
final String contentBaseClass = CLASSNAME + "-content";
final String decoBaseClass = CLASSNAME + "-deco";
- captionNode.addClassName(captionBaseClass);
- contentNode.addClassName(contentBaseClass);
- bottomDecoration.addClassName(decoBaseClass);
+ captionNode.setClassName(captionBaseClass);
+ contentNode.setClassName(contentBaseClass);
+ bottomDecoration.setClassName(decoBaseClass);
// Add proper stylenames for all elements. This way we can prevent
// unwanted CSS selector inheritance.
bottomDecoration.addClassName(decoBaseClass + "-" + style);
}
}
+
+ // Ensure panel is still scrollable
+ touchScrollHandler.addElement(contentNode);
}
// Ensure correct implementation
if (client.updateComponent(this, uidl, false)) {
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VConsole;
+import com.vaadin.terminal.gwt.client.ui.TouchScrollDelegate.TouchScrollHandler;
public class VSplitPanel extends ComplexPanel implements Container,
ContainerResizedListener {
/* The current position of the split handle in either percentages or pixels */
private String position;
+ private final TouchScrollHandler touchScrollHandler;
+
protected Element scrolledContainer;
protected int origScrollTop;
setOrientation(orientation);
sinkEvents(Event.MOUSEEVENTS);
- TouchScrollDelegate.enableTouchScrolling(this, firstContainer,
- secondContainer);
+ touchScrollHandler = TouchScrollDelegate.enableTouchScrolling(this,
+ firstContainer, secondContainer);
addDomHandler(new TouchCancelHandler() {
public void onTouchCancel(TouchCancelEvent event) {
setStylenames();
+ // Ensure panels are still scrollable
+ touchScrollHandler.setElements(firstContainer, secondContainer);
+
position = uidl.getStringAttribute("position");
setSplitPosition(position);
final String secondContainerClass = CLASSNAME + "-second-container";
final String lockedSuffix = locked ? "-locked" : "";
- splitter.addClassName(splitterClass);
- firstContainer.addClassName(firstContainerClass);
- secondContainer.addClassName(secondContainerClass);
+ splitter.setClassName(splitterClass + lockedSuffix);
+ firstContainer.setClassName(firstContainerClass);
+ secondContainer.setClassName(secondContainerClass);
for (String styleName : componentStyleNames) {
splitter.addClassName(splitterClass + "-" + styleName