Bug 837117 - Downloaded items change position in the downloads view if Clear List is selected.
authorMarco Bonardo <mbonardo@mozilla.com>
Tue, 05 Feb 2013 21:56:03 +0100
changeset 127433 0b46a4903d4c137960e092dfaac6ef895ad10329
parent 127432 8516612e2d80856e809f8e554f4f6566593dea77
child 127434 1d3935c780c296399e70ee4699aa6aeb1b4f7f94
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs837117
milestone20.0a2
Bug 837117 - Downloaded items change position in the downloads view if Clear List is selected. r=Mano a=gavin
browser/components/downloads/content/allDownloadsViewOverlay.js
--- a/browser/components/downloads/content/allDownloadsViewOverlay.js
+++ b/browser/components/downloads/content/allDownloadsViewOverlay.js
@@ -1032,18 +1032,18 @@ DownloadsPlacesView.prototype = {
       this._removeElement(shell.element);
       shells.delete(shell);
       if (shells.size == 0)
         this._downloadElementsShellsForURI.delete(aDataItem.uri);
     }
     else {
       shell.dataItem = null;
       // Move it below the session-download items;
-      if (this._lastSessionDownloadElement == shell.dataItem) {
-        this._lastSessionDownloadElement = shell.dataItem.previousSibling;
+      if (this._lastSessionDownloadElement == shell.element) {
+        this._lastSessionDownloadElement = shell.element.previousSibling;
       }
       else {
         let before = this._lastSessionDownloadElement ?
           this._lastSessionDownloadElement.nextSibling : this._richlistbox.firstChild;
         this._richlistbox.insertBefore(shell.element, before);
       }
     }
   },