private Element geckoCaptionMeter;
+ private int scrollTop;
+
+ private int scrollLeft;
+
public IPanel() {
super();
DOM.appendChild(getElement(), captionNode);
DOM.setElementProperty(bottomDecoration, "className", CLASSNAME
+ "-deco");
DOM.sinkEvents(getElement(), Event.ONKEYDOWN);
+ DOM.sinkEvents(contentNode, Event.ONSCROLL);
}
protected Element getContainerElement() {
}
}
+ if (uidl.hasVariable("scrollTop")
+ && uidl.getIntVariable("scrollTop") != scrollTop) {
+ scrollTop = uidl.getIntVariable("scrollTop");
+ DOM.setElementPropertyInt(contentNode, "scrollTop", scrollTop);
+ }
+
+ if (uidl.hasVariable("scrollLeft")
+ && uidl.getIntVariable("scrollLeft") != scrollLeft) {
+ scrollLeft = uidl.getIntVariable("scrollLeft");
+ DOM.setElementPropertyInt(contentNode, "scrollLeft", scrollLeft);
+ }
+
}
private void handleError(UIDL uidl) {
shortcutHandler.handleKeyboardEvent(event);
return;
}
- if (errorIndicatorElement != null
+ if (type == Event.ONSCROLL) {
+ int newscrollTop = DOM.getElementPropertyInt(contentNode,
+ "scrollTop");
+ int newscrollLeft = DOM.getElementPropertyInt(contentNode,
+ "scrollLeft");
+ if (client != null
+ && (newscrollLeft != scrollLeft || newscrollTop != scrollTop)) {
+ ApplicationConnection.getConsole().log("scrollded panel");
+ scrollLeft = newscrollLeft;
+ scrollTop = newscrollTop;
+ client.updateVariable(id, "scrollTop", scrollTop, false);
+ client.updateVariable(id, "scrollLeft", scrollLeft, false);
+ }
+ } else if (errorIndicatorElement != null
&& DOM.compare(target, errorIndicatorElement)) {
switch (type) {
case Event.ONMOUSEOVER: