From 6c1c4fd623a1426ef637adae82cdfab2009e7b5d Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 4 Jul 2012 20:07:16 -0400 Subject: [PATCH] Fix sporadic :downloads issue. --- common/modules/downloads.jsm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/modules/downloads.jsm b/common/modules/downloads.jsm index 23ad3dc4..b0e7ba86 100644 --- a/common/modules/downloads.jsm +++ b/common/modules/downloads.jsm @@ -28,6 +28,8 @@ var Download = Class("Download", { this.nodes = { commandTarget: self }; + XML.ignoreWhitespace = true; + XML.prettyPrinting = false; util.xmlToDom( @@ -224,8 +226,10 @@ var DownloadList = Class("DownloadList", message: Class.Memoize(function () { + XML.ignoreWhitespace = true; + XML.prettyPrinting = false; util.xmlToDom( - + {_("title.Title")}{_("title.Status")} @@ -253,6 +257,9 @@ var DownloadList = Class("DownloadList",
, 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) {