Bug 1556229 - Port bug 1554744: Make button state in language dialog correct when there are no available languages. r=jorgk DONTBUILD
authorRichard Marti <richard.marti@gmail.com>
Sun, 02 Jun 2019 11:56:08 +0200
changeset 35761 098d414457e2e508ff5099da6f4b53a46ba5c00f
parent 35760 b3ade9b78fc1313d0dfe0e127cc6a52724bf5979
child 35762 dda6d487c69a5f85cb2d34bfae4825060ca43d31
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersjorgk
bugs1556229, 1554744
Bug 1556229 - Port bug 1554744: Make button state in language dialog correct when there are no available languages. r=jorgk DONTBUILD
mail/components/preferences/messengerLanguages.js
--- a/mail/components/preferences/messengerLanguages.js
+++ b/mail/components/preferences/messengerLanguages.js
@@ -42,19 +42,19 @@ class OrderedListBox {
 
   get selectedItem() {
     return this.items[this.richlistbox.selectedIndex];
   }
 
   setButtonState() {
     let {upButton, downButton, removeButton} = this;
     let {selectedIndex, itemCount} = this.richlistbox;
-    upButton.disabled = selectedIndex == 0;
+    upButton.disabled = selectedIndex <= 0;
     downButton.disabled = selectedIndex == itemCount - 1;
-    removeButton.disabled = itemCount == 1 || !this.selectedItem.canRemove;
+    removeButton.disabled = itemCount <= 1 || !this.selectedItem.canRemove;
   }
 
   moveUp() {
     let {selectedIndex} = this.richlistbox;
     if (selectedIndex == 0) {
       return;
     }
     let {items} = this;