} else {
delegate = null;
}
- for (Element scrollable : scrollables) {
- addElement(scrollable);
- }
+ setElements(scrollables);
}
public void onTouchStart(TouchStartEvent event) {
}
public TouchScrollDelegate(Element... elements) {
- scrollableElements = new HashSet<Element>(Arrays.asList(elements));
+ setElements(elements);
}
public void setScrollHandler(ScrollHandler scrollHandler) {
}
}
+ public void setElements(Element[] elements) {
+ scrollableElements = new HashSet<Element>(Arrays.asList(elements));
+ }
+
/**
* long calcucation are not very efficient in GWT, so this helper method
* returns timestamp in double.