Пример #1
0
  protected void constrainScroll(int y) {
    int full = ul.setHeight("auto").getHeight();

    int max = maxHeight != Style.DEFAULT ? maxHeight : (XDOM.getViewHeight(false) - y);
    if (full > max && max > 0) {
      activeMax = max - 10 - scrollerHeight * 2;
      ul.setHeight(activeMax, true);
      createScrollers();
    } else {
      ul.setHeight(full, true);
      NodeList<Element> nodes = el().select(".x-menu-scroller");
      for (int i = 0; i < nodes.getLength(); i++) {
        fly(nodes.getItem(i)).hide();
      }
    }
    ul.setScrollTop(0);
  }
Пример #2
0
 @SuppressWarnings("rawtypes")
 @Override
 public void handleComponentEvent(GridEvent ge) {
   super.handleComponentEvent(ge);
   int type = ge.getEventTypeInt();
   Element target = ge.getTarget();
   if (!ignoreScroll && (type == Event.ONSCROLL && liveScroller.dom.isOrHasChild(target))
       || (type == Event.ONMOUSEWHEEL && mainBody.dom.isOrHasChild(target))) {
     ge.stopEvent();
     if (type == Event.ONMOUSEWHEEL) {
       int v = ge.getEvent().getMouseWheelVelocityY() * getCalculatedRowHeight();
       liveScroller.setScrollTop(liveScroller.getScrollTop() + v);
     } else {
       updateRows(
           (int) Math.ceil((double) liveScroller.getScrollTop() / getCalculatedRowHeight()),
           false);
     }
   }
 }
Пример #3
0
 protected void scrollMenu(boolean top) {
   ul.setScrollTop(ul.getScrollTop() + scrollIncrement * (top ? -1 : 1));
 }
Пример #4
0
 @Override
 public void scrollToTop() {
   liveScroller.setScrollTop(0);
 }