소스 검색

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
tags/7.1.8
Artur Signell 10 년 전
부모
커밋
6a63d12afc
2개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 2
    6
      client/src/com/vaadin/client/Util.java
  2. 2
    1
      client/src/com/vaadin/client/ui/VWindow.java

+ 2
- 6
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();

+ 2
- 1
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();
}

Loading…
취소
저장