1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 11:58:00 +01:00

Fix some itemlist bugs.

This commit is contained in:
Kris Maglione
2008-11-29 07:20:23 +00:00
parent 92dd546b18
commit 9200548683
2 changed files with 10 additions and 5 deletions

View File

@@ -1424,8 +1424,6 @@ function ItemList(id) //{{{
let root = nodes.root let root = nodes.root
let items = nodes.items; let items = nodes.items;
let [start, end] = getRows(context); let [start, end] = getRows(context);
if (start == end)
return;
for (let [i, row] in Iterator(context.getRows(start, end, doc))) for (let [i, row] in Iterator(context.getRows(start, end, doc)))
nodes[i] = row; nodes[i] = row;
@@ -1437,8 +1435,12 @@ function ItemList(id) //{{{
if (display && row.parentNode != items) if (display && row.parentNode != items)
{ {
do do
{
var next = nodes[++i]; var next = nodes[++i];
while ((!next || next.parentNode != items) && i < end) if (next && next.parentNode != items)
next = null;
}
while (!next && i < end)
items.insertBefore(row, next); items.insertBefore(row, next);
} }
else if (!display && row.parentNode == items) else if (!display && row.parentNode == items)
@@ -1508,6 +1510,7 @@ function ItemList(id) //{{{
if (selIndex < 0) if (selIndex < 0)
newOffset = 0; newOffset = 0;
selIndex = -1; selIndex = -1;
index = -1;
} }
else else
{ {
@@ -1523,9 +1526,10 @@ function ItemList(id) //{{{
} }
if (sel > -1) if (sel > -1)
getCompletion(selIndex).removeAttribute("selected"); getCompletion(sel).removeAttribute("selected");
fill(newOffset); fill(newOffset);
getCompletion(index).setAttribute("selected", "true"); if (index >= 0)
getCompletion(index).setAttribute("selected", "true");
//if (index == 0) //if (index == 0)
// this.start = now; // this.start = now;

View File

@@ -290,6 +290,7 @@ const util = { //{{{
try try
{ {
let xmlhttp = new XMLHttpRequest(); let xmlhttp = new XMLHttpRequest();
xmlhttp.mozBackgroundRequest = true;
if (callback) if (callback)
{ {
xmlhttp.onreadystatechange = function () { xmlhttp.onreadystatechange = function () {