Bug 1554744 - make button state in browser language dialog correct when there's no available languages, r=johannh
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 31 May 2019 13:55:56 +0000
changeset 476393 3b4847a2951e522a6e449ec34c9b9f4bf46c5330
parent 476365 5367531b598c04c6478605832fbafc2df0184c40
child 476394 04a437eb5be6443fa88c1d76f5299ca66547162c
push id36094
push useraiakab@mozilla.com
push dateFri, 31 May 2019 21:48:40 +0000
treeherdermozilla-central@a73077366144 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1554744
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1554744 - make button state in browser language dialog correct when there's no available languages, r=johannh 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;