Bug 592252 - Restart is required when pressing the down arrow in localization and autodetect is selected already [r=mbrubeck]

This commit is contained in:
Mark Finkle 2010-10-13 09:44:31 -04:00
parent b093279bb9
commit 234f5bd6f8
2 changed files with 14 additions and 3 deletions

View File

@ -1493,6 +1493,15 @@
MenuListHelperUI.show(this);
]]>
</handler>
<handler event="command" phase="capturing">
<![CDATA[
// The dropmark (button) fires a command event too. Don't forward that.
// Just forward the menuitem command events, which the toolkit version does.
if (event.target.parentNode.parentNode != this)
event.stopPropagation();
]]>
</handler>
</handlers>
</binding>

View File

@ -159,10 +159,12 @@ var PreferencesView = {
catch (e) {}
// Highlight current locale (or auto-detect entry)
if (autoDetect)
if (autoDetect) {
this._languages.selectedItem = document.getElementById("prefs-languages-auto");
else
this._currentLocale = "auto";
} else {
this._languages.selectedItem = selectedItem;
}
// Hide the setting if we only have one locale
if (localeCount == 1)
@ -173,7 +175,7 @@ var PreferencesView = {
// Which locale did the user select?
let newLocale = this._languages.selectedItem.value;
let prefs = Services.prefs;
if (newLocale == "auto") {
if (prefs.prefHasUserValue("general.useragent.locale"))
prefs.clearUserPref("general.useragent.locale");