Bug 1280799 - Update the state of the 'Clear Downloads' button when download item state changes, even if the item is selected. r?paolo draft
authorJared Wein <jwein@mozilla.com>
Thu, 23 Jun 2016 14:35:43 -0400
changeset 380942 d58c8011187f7d08ba0f718c13a3373ada808bfd
parent 377637 0cdadfe2548071a155138fa486b7ed7753f68bee
child 523849 531a0e7ec2f99acfa4f8853b3e62df5e50a84c56
push id21358
push userjwein@mozilla.com
push dateThu, 23 Jun 2016 18:36:15 +0000
reviewerspaolo
bugs1280799
milestone50.0a1
Bug 1280799 - Update the state of the 'Clear Downloads' button when download item state changes, even if the item is selected. r?paolo MozReview-Commit-ID: 2YXLDuBxkTe
browser/components/downloads/content/allDownloadsViewOverlay.js
--- a/browser/components/downloads/content/allDownloadsViewOverlay.js
+++ b/browser/components/downloads/content/allDownloadsViewOverlay.js
@@ -297,19 +297,18 @@ HistoryDownloadElementShell.prototype = 
     return status;
   },
 
   onStateChanged() {
     this._updateState();
 
     if (this.element.selected) {
       goUpdateDownloadCommands();
-    } else {
-      goUpdateCommand("downloadsCmd_clearDownloads");
     }
+    goUpdateCommand("downloadsCmd_clearDownloads");
   },
 
   onChanged() {
     // This cannot be placed within onStateChanged because
     // when a download goes from hasBlockedData to !hasBlockedData
     // it will still remain in the same state.
     this.element.classList.toggle("temporary-block",
                                   !!this.download.hasBlockedData);