/** * Add to the root panel and then position appropriately. */ public void showOver(Element element) { rootPanel.add(this); getElement().removeClassName("hide"); //$NON-NLS-1$ positionOver(getElement(), element); registration = Window.addWindowScrollHandler(new ScrollHandler() { @Override public void onWindowScroll(ScrollEvent event) { close(); } }); }
@Override public void onWindowScroll(ScrollEvent event) { if (ignoreNextScrollEvent) { ignoreNextScrollEvent = false; } else if (deviceInLandscapeMode() && state == State.STOPPED && height != getWindowHeight()) { onScreenKeyboardMightBeVisible &= Document.get() .getDocumentElement().getOffsetHeight() != getWindowHeight(); if (!onScreenKeyboardMightBeVisible) { schedule(2); } } }