import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.ComplexPanel;
+import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection;
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo;
private String splitterStyleName;
+ private Element draggingCurtain;
+
public ISplitPanel() {
this(ORIENTATION_HORIZONTAL);
}
if (DOM.compare(trg, splitter)
|| DOM.compare(trg, DOM.getChild(splitter, 0))) {
resizing = true;
+ if (BrowserInfo.get().isGecko()) {
+ showDraggingCurtain();
+ }
DOM.setCapture(getElement());
origX = DOM.getElementPropertyInt(splitter, "offsetLeft");
origY = DOM.getElementPropertyInt(splitter, "offsetTop");
public void onMouseUp(Event event) {
DOM.releaseCapture(getElement());
+ if (BrowserInfo.get().isGecko()) {
+ hideDraggingCurtain();
+ }
resizing = false;
onMouseMove(event);
}
+ /**
+ * Used in FF to avoid losing mouse capture when pointer is moved on an
+ * iframe.
+ */
+ private void showDraggingCurtain() {
+ if (draggingCurtain == null) {
+ draggingCurtain = DOM.createDiv();
+ DOM.setStyleAttribute(draggingCurtain, "position", "absolute");
+ DOM.setStyleAttribute(draggingCurtain, "top", "0px");
+ DOM.setStyleAttribute(draggingCurtain, "left", "0px");
+ DOM.setStyleAttribute(draggingCurtain, "width", "100%");
+ DOM.setStyleAttribute(draggingCurtain, "height", "100%");
+ DOM.setStyleAttribute(draggingCurtain, "zIndex", ""
+ + IToolkitOverlay.Z_INDEX);
+ DOM.appendChild(RootPanel.getBodyElement(), draggingCurtain);
+ }
+ }
+
+ /**
+ * Hides dragging curtain
+ */
+ private void hideDraggingCurtain() {
+ if (draggingCurtain != null) {
+ DOM.removeChild(RootPanel.getBodyElement(), draggingCurtain);
+ draggingCurtain = null;
+ }
+ }
+
private static int splitterSize = -1;
private int getSplitterSize() {