From 02192bd867dd7e7c2990f550e4e58988d188774f Mon Sep 17 00:00:00 2001 From: "shanjian%netscape.com" Date: Mon, 22 Jan 2001 20:28:17 +0000 Subject: [PATCH] #62690 need to handle double click in language add dialog box r = nhotta sr = ben --- .../resources/content/pref-languages-add.xul | 2 +- .../resources/content/pref-languages.js | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/xpfe/components/prefwindow/resources/content/pref-languages-add.xul b/xpfe/components/prefwindow/resources/content/pref-languages-add.xul index 3aaf59cb8933..e1ada761d89d 100644 --- a/xpfe/components/prefwindow/resources/content/pref-languages-add.xul +++ b/xpfe/components/prefwindow/resources/content/pref-languages-add.xul @@ -45,7 +45,7 @@ &languages.customize.available.label; + datasources="rdf:null" multiple="true" ondblclick="HandleDoubleClick(event.target)"> diff --git a/xpfe/components/prefwindow/resources/content/pref-languages.js b/xpfe/components/prefwindow/resources/content/pref-languages.js index 6bef179ae36d..669d40310774 100644 --- a/xpfe/components/prefwindow/resources/content/pref-languages.js +++ b/xpfe/components/prefwindow/resources/content/pref-languages.js @@ -123,7 +123,7 @@ function AddLanguage() { //cludge: make pref string available from the popup document.getElementById('intlAcceptLanguages').value = pref_string; - window.openDialog("chrome://communicator/content/pref/pref-languages-add.xul","","modal=yes,chrome,resizable=no", "addlangwindow"); + window.openDialog("chrome://communicator/content/pref/pref-languages-add.xul","","modal=yes,chrome,resizable=yes", "addlangwindow"); UpdateSavePrefString(); } @@ -395,6 +395,19 @@ function AddAvailableLanguage() return true; } //AddAvailableLanguage +function HandleDoubleClick(node) +{ + var languageId = node.id; + var languageName = node.getAttribute('value'); + + if (languageName && languageName.length > 0) + { + if (!LangAlreadyActive(languageId)) { + AddTreeItem(window.opener.document, active_languages_treeroot, languageId, languageName); + } + window.close(); + }//if +} //HandleDoubleClick function RemoveActiveLanguage() {