diff --git a/profile/resources/content/selectLang.js b/profile/resources/content/selectLang.js index 95a8dd33213..84e1f147acf 100644 --- a/profile/resources/content/selectLang.js +++ b/profile/resources/content/selectLang.js @@ -9,22 +9,41 @@ function Startup() tree.selectItem(elements[0].parentNode.parentNode); } else { - var kids = document.getElementById("treechildren"); - tree.selectItem(kids); + tree.selectedIndex = 0; + } + + var selectedRegion = window.arguments.length ? window.arguments[1] : null; + var list = document.getElementById("regionList"); + if (selectedRegion) { + var elements = list.getElementsByAttribute("value", selectedRegion); + if (elements.length) + list.selectedItem = elements[0]; + } else { + list.selectedIndex = 1; } } function onOK() { + //cache language on the parent window var tree = document.getElementById("langList"); var selectedItem = tree.selectedItems.length ? tree.selectedItems[0] : null; if (selectedItem) { var langName = selectedItem.firstChild.firstChild.getAttribute("value"); - var langStore = opener.document.getElementById("ProfileLocale"); + var langStore = opener.document.getElementById("ProfileLanguage"); if (langStore) langStore.setAttribute("data", langName); } + + //cache region on the parent window + var list = document.getElementById("regionList"); + var selectedItem = list.selectedItem; + if (selectedItem) { + var regionName = selectedItem.getAttribute("value"); + var regionStore = opener.document.getElementById("ProfileRegion"); + if (regionStore) + regionStore.setAttribute("data", regionName); + } + window.close(); } - - diff --git a/profile/resources/content/selectLang.xul b/profile/resources/content/selectLang.xul index bf3ecf35eef..13a646cfe5d 100644 --- a/profile/resources/content/selectLang.xul +++ b/profile/resources/content/selectLang.xul @@ -27,18 +27,18 @@ -