Bug 309538 Autoscroll indicator should show possible scrolling directions

r=db48x, sr=neil, icons by neil
This commit is contained in:
cst%andrew.cmu.edu 2006-07-29 05:44:36 +00:00
parent 59cb3a5e99
commit 397bd3e22b

View File

@ -605,9 +605,22 @@ function startScrolling(event)
document.documentElement.appendChild(gAutoScrollPopup); document.documentElement.appendChild(gAutoScrollPopup);
} }
gScrollingView = event.originalTarget.ownerDocument.defaultView;
var scrollingDir;
if (gScrollingView.scrollMaxX > 0) {
gAutoScrollPopup.setAttribute("scrolldir", gScrollingView.scrollMaxY > 0 ? "NSEW" : "EW");
}
else if (gScrollingView.scrollMaxY > 0) {
gAutoScrollPopup.setAttribute("scrolldir", "NS");
}
else {
gScrollingView = null; // abort scrolling
return;
}
document.popupNode = null; document.popupNode = null;
gAutoScrollPopup.showPopup(document.documentElement, event.screenX, event.screenY, gAutoScrollPopup.showPopup(document.documentElement, event.screenX, event.screenY,
"popup", null, null); "popup", null, null);
gIgnoreMouseEvents = true; gIgnoreMouseEvents = true;
gStartX = event.screenX; gStartX = event.screenX;
gStartY = event.screenY; gStartY = event.screenY;
@ -617,7 +630,6 @@ function startScrolling(event)
addEventListener('mouseup', handleMouseUpDown, true); addEventListener('mouseup', handleMouseUpDown, true);
addEventListener('mousedown', handleMouseUpDown, true); addEventListener('mousedown', handleMouseUpDown, true);
gAutoScrollTimer = setInterval(autoScrollLoop, 10); gAutoScrollTimer = setInterval(autoScrollLoop, 10);
gScrollingView = event.originalTarget.ownerDocument.defaultView;
} }
function handleMouseMove(event) function handleMouseMove(event)