Пример #1
0
 @Override
 public void onComponentEvent(ComponentEvent ce) {
   super.onComponentEvent(ce);
   switch (ce.getEventTypeInt()) {
     case Event.ONCLICK:
       onClick(ce);
       break;
     case Event.ONMOUSEMOVE:
       onMouseMove(ce);
       break;
     case Event.ONMOUSEOUT:
       onMouseOut(ce);
       break;
     case Event.ONMOUSEOVER:
       onMouseOver(ce);
       break;
     case Event.ONMOUSEWHEEL:
       if (enableScrolling) {
         scrollMenu(ce.getEvent().getMouseWheelVelocityY() < 0);
       }
   }
   El t = ce.getTargetEl();
   if (enableScrolling && t.is(".x-menu-scroller")) {
     switch (ce.getEventTypeInt()) {
       case Event.ONMOUSEOVER:
         // deactiveActiveItem();
         onScrollerIn(t);
         break;
       case Event.ONMOUSEOUT:
         onScrollerOut(t);
         break;
     }
   }
 }
Пример #2
0
  protected void onScroll(ClickRepeaterEvent ce) {
    El target = ce.getEl();
    boolean top = target.is(".x-menu-scroller-top");
    scrollMenu(top);

    if (top
        ? ul.getScrollTop() <= 0
        : ul.getScrollTop() + activeMax >= ul.dom.getPropertyInt("scrollHeight")) {
      onScrollerOut(target);
    }
  }