Bug 1569749 - Update spellcheck context menu - Port Bug 1071771 "disable dictionary list when it cannot be accessed from another process". r=frg a=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Wed, 31 Jul 2019 21:56:04 +0200
changeset 32255 fefca2976fee13e40bc01466a3f24fba76c28ad2
parent 32254 a73b3a81a817f34e124aed51433f7f4a98664574
child 32256 d40072488eaea90bd58f1336f0b32d2a0e228730
push id208
push userfrgrahl@gmx.net
push dateWed, 31 Jul 2019 19:58:37 +0000
treeherdercomm-esr60@2375c07411d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs1569749, 1071771
Bug 1569749 - Update spellcheck context menu - Port Bug 1071771 "disable dictionary list when it cannot be accessed from another process". r=frg a=frg
suite/base/content/nsContextMenu.js
--- a/suite/base/content/nsContextMenu.js
+++ b/suite/base/content/nsContextMenu.js
@@ -373,17 +373,18 @@ nsContextMenu.prototype = {
       this.showItem("spell-no-suggestions", false);
     }
 
     // dictionary list
     this.showItem("spell-dictionaries", showDictionaries);
     var dictMenu = document.getElementById("spell-dictionaries-menu");
     if (canSpell && dictMenu) {
       var dictSep = document.getElementById("spell-language-separator");
-      InlineSpellCheckerUI.addDictionaryListToMenu(dictMenu, dictSep);
+      let count = InlineSpellCheckerUI.addDictionaryListToMenu(dictMenu, dictSep);
+      this.showItem(dictSep, count > 0);
       this.showItem("spell-add-dictionaries-main", false);
     }
     else if (this.onEditableArea) {
       // when there is no spellchecker but we might be able to spellcheck
       // add the add to dictionaries item. This will ensure that people
       // with no dictionaries will be able to download them
       this.showItem("spell-language-separator", showDictionaries);
       this.showItem("spell-add-dictionaries-main", showDictionaries);