Exemple #1
0
 protected void clean() {
   thumb.style.display = "none";
   document.body.style.cursor = "auto";
   if (hSelectStart != null) {
     Clazz.removeEvent(thumb, "selectstart", hSelectStart);
     hSelectStart = null;
   }
   // thumb.parentNode.removeChild(thumb);
   OS.destroyHandle(thumb);
   if (overFrameHandle != null) {
     // document.body.removeChild(overFrameHandle);
     OS.destroyHandle(overFrameHandle);
     overFrameHandle = null;
   }
 }
Exemple #2
0
  public boolean dragBegan(DragEvent e) {
    thumb = document.createElement("DIV");
    String cssName = e.sourceElement.className;
    thumb.className = cssName;
    if (cssName != null && cssName.indexOf("sash-mouse-down") == -1) {
      thumb.className += " sash-mouse-down";
    }
    if (cssName.indexOf("horizontal") != -1) {
      isHorizontal = true;
    } else {
      isHorizontal = false;
    }
    thumb.style.left = e.sourceElement.style.left;
    thumb.style.top = e.sourceElement.style.top;
    thumb.style.width = e.sourceElement.style.width;
    thumb.style.height = e.sourceElement.style.height;
    if (hSelectStart == null) {
      hSelectStart = DNDUtils.onselectstart;
      Clazz.addEvent(thumb, "selectstart", hSelectStart);
    }
    if (e.sourceElement.nextSibling != null) {
      e.sourceElement.parentNode.insertBefore(thumb, e.sourceElement.nextSibling);
    } else {
      e.sourceElement.parentNode.appendChild(thumb);
    }
    CSSStyle style = e.sourceElement.style;

    this.sourceX = style.left.length() > 0 ? Integer.parseInt(style.left) : 0;
    this.sourceY = style.top.length() > 0 ? Integer.parseInt(style.top) : 0;
    /* first time, set start location to current location */
    e.startX = e.currentX;
    e.startY = e.currentY;
    Element[] frames = document.getElementsByTagName("IFRAME");
    boolean needOverIFrameLayer = false;
    for (int i = 0; i < frames.length; i++) {
      if (frames[i].style.display != "none") {
        needOverIFrameLayer = true;
        break;
      }
    }
    if (needOverIFrameLayer) {
      overFrameHandle = document.createElement("DIV");
      overFrameHandle.className = "over-iframe-layer";
      overFrameHandle.style.zIndex = window.currentTopZIndex;
      document.body.appendChild(overFrameHandle);
    }
    return true;
  }