use of com.google.gwt.user.client.Element in project GwtMobile by dennisjzh.
the class ScrollPanel method onDragEnd.
@Override
public void onDragEnd(DragEvent e) {
Element widgetEle = getWidget().getElement();
int current = getScrollPosition();
if (current == 0) {
return;
}
int panelHeight = Utils.getHeight(this.getElement());
int widgetHeight = widgetEle.getOffsetHeight();
if (//exceed top boundary
current > 0 || panelHeight > widgetHeight) {
Utils.setTransitionDuration(widgetEle, 500);
setScrollPosition(0);
} else if (-current + panelHeight > widgetHeight) {
//exceed bottom boundary
Utils.setTransitionDuration(widgetEle, 500);
setScrollPosition(panelHeight - widgetHeight);
}
}
use of com.google.gwt.user.client.Element in project GwtMobile by dennisjzh.
the class TextArea method onKeyUp.
@Override
public void onKeyUp(KeyUpEvent event) {
Element ele = getElement();
final int extraLineHeight = 15;
int scrollHeight = ele.getScrollHeight();
int clientHeight = ele.getClientHeight();
Utils.Console(scrollHeight + " " + clientHeight);
if (clientHeight < scrollHeight) {
ele.getStyle().setHeight(scrollHeight + extraLineHeight, Unit.PX);
}
}
Aggregations