summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-11-04 20:23:27 +0200
committerVaadin Code Review <review@vaadin.com>2013-11-05 06:54:44 +0000
commit6a63d12afc5a4bf3971dd016f8e2761cd27bcc74 (patch)
tree032df0eec4297d504be8cf394b6383de2a290726
parent15dce287e52134dbd3cced24a4ef0eb807ffc49d (diff)
downloadvaadin-framework-6a63d12afc5a4bf3971dd016f8e2761cd27bcc74.tar.gz
vaadin-framework-6a63d12afc5a4bf3971dd016f8e2761cd27bcc74.zip
Make Panel scroll the correct div (#12736)
Redefined util method to take the scrollable instead of its parent to make it useful also for cases where the first child is not scrollable Change-Id: I301d260d26373b38fdee525f169347bb7b4c499e
-rw-r--r--client/src/com/vaadin/client/Util.java8
-rw-r--r--client/src/com/vaadin/client/ui/VWindow.java3
2 files changed, 4 insertions, 7 deletions
diff --git a/client/src/com/vaadin/client/Util.java b/client/src/com/vaadin/client/Util.java
index 206aa83c2b..9cdfa954c6 100644
--- a/client/src/com/vaadin/client/Util.java
+++ b/client/src/com/vaadin/client/Util.java
@@ -525,12 +525,11 @@ public class Util {
* See: bugs #11994 and #12736.
*
* @param contentNode
- * an element that contains a scrollable element as its first
- * child
+ * an element that is scrollable
*
* @since 7.1.8
*/
- public static void removeUnneededScrollbars(final Element contentNode) {
+ public static void removeUnneededScrollbars(final Element scrollable) {
if (BrowserInfo.get().isWebkit()) {
/*
@@ -544,9 +543,6 @@ public class Util {
@Override
public void execute() {
- final com.google.gwt.dom.client.Element scrollable = contentNode
- .getFirstChildElement();
-
// Adjusting the width or height may change the scroll
// position, so store the current position
int horizontalScrollPosition = scrollable.getScrollLeft();
diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java
index 3e71c0af50..9f19a3e0ab 100644
--- a/client/src/com/vaadin/client/ui/VWindow.java
+++ b/client/src/com/vaadin/client/ui/VWindow.java
@@ -343,7 +343,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
super.setVisible(visible);
}
if (visible && BrowserInfo.get().isWebkit()) {
- Util.removeUnneededScrollbars(contents);
+ Util.removeUnneededScrollbars((Element) contents
+ .getFirstChildElement());
updateContentsSize();
positionOrSizeUpdated();
}