Bug 602571 - "Downloads added after showing list once are added at wrong position" [r=mark.finkle]
authorWesley Johnston <wjohnston@mozilla.com>
Thu, 07 Oct 2010 10:56:00 -0400
changeset 66802 5e7125f770525c997ebcfda47cc5dc7b86a36ee6
parent 66801 08ce1521fbde5b951910d82a48b1a00f9e123f90
child 66803 86382dea0abba628324fe9c0340ebfe6e77d9c7f
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs602571
Bug 602571 - "Downloads added after showing list once are added at wrong position" [r=mark.finkle]
mobile/chrome/content/downloads.js
--- a/mobile/chrome/content/downloads.js
+++ b/mobile/chrome/content/downloads.js
@@ -269,19 +269,20 @@ var DownloadsView = {
       maxBytes: aDownload.size
     };
 
     // Remove the "no downloads" item, if visible
     let emptyItem = document.getElementById("dl-empty-message");
     if (emptyItem)
       this._list.removeChild(emptyItem);
       
-    // Make the item and add it to the beginning
+    // Make the item and add it to the beginning (but before the header)
+    let header = document.getElementById("downloads-list-header");
     let item = this._createItem(attrs);
-    this._list.insertBefore(item, this._list.firstChild);
+    this._list.insertBefore(item, header.nextSibling);
   },
 
   downloadCompleted: function dv_downloadCompleted(aDownload) {
     // Move the download below active
     let element = this.getElementForDownload(aDownload.id);
 
     // Iterate down until we find a non-active download
     let next = element.nextSibling;