1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-29 04:42:27 +01:00

Fix sporadic :downloads issue.

This commit is contained in:
Kris Maglione
2012-07-04 20:07:16 -04:00
parent e9c33a4c03
commit 6c1c4fd623

View File

@@ -28,6 +28,8 @@ var Download = Class("Download", {
this.nodes = {
commandTarget: self
};
XML.ignoreWhitespace = true;
XML.prettyPrinting = false;
util.xmlToDom(
<tr highlight="Download" key="row" xmlns:dactyl={NS} xmlns={XHTML}>
<td highlight="DownloadTitle">
@@ -224,8 +226,10 @@ var DownloadList = Class("DownloadList",
message: Class.Memoize(function () {
XML.ignoreWhitespace = true;
XML.prettyPrinting = false;
util.xmlToDom(<table highlight="Downloads" key="list" xmlns={XHTML}>
<tr highlight="DownloadHead">
<tr highlight="DownloadHead" key="head">
<span>{_("title.Title")}</span>
<span>{_("title.Status")}</span>
<span/>
@@ -253,6 +257,9 @@ var DownloadList = Class("DownloadList",
</tr>
</table>, this.document, this.nodes);
this.index = Array.indexOf(this.nodes.list.childNodes,
this.nodes.head);
for (let row in iter(services.downloadManager.DBConnection
.createStatement("SELECT id FROM moz_downloads")))
this.addDownload(row.id);
@@ -274,7 +281,7 @@ var DownloadList = Class("DownloadList",
.indexOf(download);
this.nodes.list.insertBefore(download.nodes.row,
this.nodes.list.childNodes[index + 1]);
this.nodes.list.childNodes[index + this.index + 1]);
}
},
removeDownload: function removeDownload(id) {