mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-30 12:40:25 +00:00
Bug 323818: land previously reviewed (bug 305730, r=mconnor/doron) richlistbox changes that were only checked in on the branch, patch by Simon B�nzli <zeniko@gmail.com>
This commit is contained in:
parent
90f8e80156
commit
68ce4617cc
@ -312,7 +312,7 @@
|
||||
y.value += this.scrollBoxObject.y;
|
||||
|
||||
// Partially visible items are also considered visible
|
||||
return (aItem.boxObject.y + aItem.boxObject.height >= y.value) &&
|
||||
return (aItem.boxObject.y + aItem.boxObject.height > y.value) &&
|
||||
(aItem.boxObject.y < y.value + this.scrollBoxObject.height);
|
||||
]]>
|
||||
</body>
|
||||
@ -345,12 +345,18 @@
|
||||
this.scrollBoxObject.scrollBy(0, this.scrollBoxObject.height * aDirection);
|
||||
|
||||
// Figure out, how many items fully fit into the view port
|
||||
// (measuring from the top of the currently selected one), and
|
||||
// determine the index of the first one lying (partially) outside
|
||||
// (including the currently selected one), and determine
|
||||
// the index of the first one lying (partially) outside
|
||||
var height = this.scrollBoxObject.height;
|
||||
while (height >= 0 && index >= 0 && index < children.length) {
|
||||
var actualIndex = (index > 0 && aDirection == -1) ? index - 1 : index;
|
||||
height -= children[actualIndex].boxObject.height;
|
||||
var border = currentItem.boxObject.y;
|
||||
if (aDirection == -1)
|
||||
border += currentItem.boxObject.height;
|
||||
while (index >= 0 && index < children.length) {
|
||||
var border2 = children[index].boxObject.y;
|
||||
if (aDirection == -1)
|
||||
border2 += children[index].boxObject.height;
|
||||
if ((border2 - border) * aDirection > height)
|
||||
break;
|
||||
index += aDirection;
|
||||
}
|
||||
index -= aDirection;
|
||||
|
Loading…
Reference in New Issue
Block a user