Bug 1554744 - make button state in browser language dialog correct when there's no available languages, r=johannh a=jcristau
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 31 May 2019 13:55:56 +0000
changeset 536633 fa85a070d83364097722aeb109b110eba62b51f8
parent 536632 736e8d1c1c44873cbd829ef9b97f890111700b51
child 536634 a6afed16db75cd107adb3157413cdfafb75894fa
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh, jcristau
bugs1554744
milestone68.0
Bug 1554744 - make button state in browser language dialog correct when there's no available languages, r=johannh a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D33273
browser/components/preferences/browserLanguages.js
--- a/browser/components/preferences/browserLanguages.js
+++ b/browser/components/preferences/browserLanguages.js
@@ -73,19 +73,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;