diff options
author | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-05-09 11:44:20 +0000 |
---|---|---|
committer | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-05-09 11:44:20 +0000 |
commit | 2f9e56f46e59152d9bed498eb72586fb3f9e15dd (patch) | |
tree | 76d4fccfa4d3100e69dd948d8b7281b937edd100 /src | |
parent | af19523dd55e1a81acabade6b8ade096ffa7d785 (diff) | |
download | vaadin-framework-2f9e56f46e59152d9bed498eb72586fb3f9e15dd.tar.gz vaadin-framework-2f9e56f46e59152d9bed498eb72586fb3f9e15dd.zip |
TouchScrollHandler: added debug info, restored setElements()
svn changeset:23697/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java b/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java index 65d8029593..580313f433 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java @@ -98,11 +98,20 @@ public class TouchScrollDelegate implements NativePreviewHandler { public TouchScrollHandler(Widget widget, Element... scrollables) { if (requiresDelegate) { + VConsole.log("REQUIRES DELEGATE"); delegate = new TouchScrollDelegate(); widget.addDomHandler(this, TouchStartEvent.getType()); } else { + VConsole.log("DOES NOT REQUIRE DELEGATE"); delegate = null; } + VConsole.log(BrowserInfo.getBrowserString()); + BrowserInfo bi = BrowserInfo.get(); + VConsole.log("Is Android: " + bi.isAndroid()); + VConsole.log("Is Android with broken scrolltop: " + + bi.isAndroidWithBrokenScrollTop()); + VConsole.log("Is IOS: " + bi.isIOS()); + VConsole.log("Is Webkit: " + bi.isWebkit()); for (Element scrollable : scrollables) { addElement(scrollable); } @@ -113,11 +122,22 @@ public class TouchScrollDelegate implements NativePreviewHandler { delegate.onTouchStart(event); } + public void debug(Element e) { + VConsole.log("Classes: " + e.getClassName() + " overflow: " + + e.getStyle().getProperty("overflow") + " w-o-s: " + + e.getStyle().getProperty("-webkit-overflow-scrolling")); + } + public void addElement(Element scrollable) { scrollable.addClassName("v-scrollable"); + scrollable.getStyle().setProperty("-webkit-overflow-scrolling", + "touch"); + scrollable.getStyle().setProperty("overflow-y", "auto"); + scrollable.getStyle().setProperty("overflow-x", "hidden"); if (requiresDelegate) { delegate.scrollableElements.add(scrollable); } + VConsole.log("Added scrollable: " + scrollable.getClassName()); } public void removeElement(Element scrollable) { @@ -126,6 +146,15 @@ public class TouchScrollDelegate implements NativePreviewHandler { delegate.scrollableElements.remove(scrollable); } } + + public void setElements(Element... scrollables) { + if (requiresDelegate) { + delegate.scrollableElements.clear(); + } + for (Element e : scrollables) { + addElement(e); + } + } } public static TouchScrollHandler enableTouchScrolling(Widget widget, |