From d1373682d682ba4b8a65e036ccae40a2eb2bea3e Mon Sep 17 00:00:00 2001 From: "hewitt%netscape.com" Date: Sat, 1 Dec 2001 06:38:42 +0000 Subject: [PATCH] 101958 - outliner drag-n-drop without changing columns sorts on that column, r=jag, sr=blake --- .../resources/content/bindings/outliner.xml | 75 ++++++++++++------- 1 file changed, 48 insertions(+), 27 deletions(-) diff --git a/xpfe/global/resources/content/bindings/outliner.xml b/xpfe/global/resources/content/bindings/outliner.xml index 48c3e7adbc6..7eed762632c 100644 --- a/xpfe/global/resources/content/bindings/outliner.xml +++ b/xpfe/global/resources/content/bindings/outliner.xml @@ -726,6 +726,8 @@ var col = document.outlinercolDragging; if (!col) return; + // determine if we have moved the mouse far enough + // to initiate a drag if (col.mDragGesturing) { if (Math.abs(aEvent.clientX - col.mStartDragX) < 5 && Math.abs(aEvent.clientY - col.mStartDragY) < 5) { @@ -733,21 +735,23 @@ } else { col.mDragGesturing = false; col.setAttribute("dragging", "true"); + window.addEventListener("click", col.onDragMouseClick, true); } } var pos = {}; var targetCol = col.parentNode._getColumnAtX(aEvent.clientX, 0.5, pos); + // bail if we haven't mousemoved to a different column if (col.mTargetCol == targetCol && col.mTargetDir == pos.value) return; + var sib; if (col.mTargetCol) { // remove previous insertbefore/after attributes col.mTargetCol.removeAttribute("insertbefore"); col.mTargetCol.removeAttribute("insertafter"); - var sib = col.mTargetCol.boxObject.previousSibling; - var sib = col.mTargetCol._previousVisibleColumn; + sib = col.mTargetCol._previousVisibleColumn; if (sib) sib.removeAttribute("insertafter"); col.mTargetCol = null; @@ -760,7 +764,7 @@ targetCol.setAttribute("insertafter", "true"); } else { targetCol.setAttribute("insertbefore", "true"); - var sib = targetCol._previousVisibleColumn; + sib = targetCol._previousVisibleColumn; if (sib) sib.setAttribute("insertafter", "true"); } @@ -770,8 +774,7 @@ // XXX should really just invalidate columns // XXX need to implement nsIOutlinerBoxObject::invalidateColumn(in long column) - var bx = col.parentNode.boxObject.QueryInterface(Components.interfaces.nsIOutlinerBoxObject); - bx.invalidate(); + col.parentNode.outlinerBoxObject.invalidate(); ]]> @@ -780,34 +783,52 @@ + + + +