Bug 490121 - Drag & drop scrolling in places menus needs to be more responsive. r=enn

This commit is contained in:
Dão Gottwald 2009-05-14 00:46:34 +02:00
Родитель e5d622ec29
Коммит 5d8a81436f
2 изменённых файлов: 13 добавлений и 12 удалений

Просмотреть файл

@ -125,7 +125,7 @@
var scrollDir = anonid == "scrollbutton-up" ? -1 :
anonid == "scrollbutton-down" ? 1 : 0;
if (scrollDir != 0) {
this._scrollBox.scrollByIndex(scrollDir);
this._scrollBox.scrollByIndex(scrollDir, false);
}
// Check if we should hide the drop indicator for this target

Просмотреть файл

@ -265,10 +265,21 @@
<method name="scrollByIndex">
<parameter name="index"/>
<parameter name="aSmoothScroll"/>
<body><![CDATA[
if (index == 0)
return;
// Each scrollByIndex call is expected to scroll the given number of
// items. If a previous call is still in progress because of smooth
// scrolling, we need to complete it before starting a new one.
if (this._scrollTarget) {
let elements = this._getScrollableElements();
if (this._scrollTarget != elements[0] &&
this._scrollTarget != elements[elements.length - 1])
this.ensureElementIsVisible(this._scrollTarget, false);
}
var rect = this.scrollClientRect;
var [start, end] = this._startEndProps;
var x = index > 0 ? rect[end] + 1 : rect[start] - 1;
@ -290,7 +301,7 @@
index--;
}
this.ensureElementIsVisible(targetElement);
this.ensureElementIsVisible(targetElement, aSmoothScroll);
]]></body>
</method>
@ -431,16 +442,6 @@
// because many users have a vertical scroll wheel but no
// horizontal support.
// Each mouse scroll is expected to scroll event.detail items. If a
// previous scroll is still in progress because of smooth scrolling,
// we need to complete it before starting a new one.
if (this._scrollTarget) {
let elements = this._getScrollableElements();
if (this._scrollTarget != elements[0] &&
this._scrollTarget != elements[elements.length - 1])
this.ensureElementIsVisible(this._scrollTarget, false);
}
this.scrollByIndex(event.detail);
event.stopPropagation();
]]></handler>