Fixed 'Current Navigator window' problems in OpenLocation dialog when used from Composer, b=91979, r=brade, sr=blake

This commit is contained in:
cmanske%netscape.com 2001-08-02 21:57:42 +00:00
Родитель b201cef7d7
Коммит c4dc65db9d
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -45,7 +45,19 @@ function onLoad()
if (!browser) {
// No browser supplied - we are calling from Composer
dialog.openAppList.selectedItem = dialog.openEditWindow;
dialog.openTopWindow.setAttribute("disabled", "true");
// Change string to make more sense for Composer
dialog.openTopWindow.setAttribute("label", dialog.bundle.getString("existingNavigatorWindow"));
// Find most recent browser window
var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
if (windowManagerInterface)
browser = windowManagerInterface.getMostRecentWindow( "navigator:browser" );
// Disable "current browser" item if no browser is open
if (!browser)
dialog.openTopWindow.setAttribute("disabled", "true");
}
else {
dialog.openAppList.selectedItem = dialog.openTopWindow;

Просмотреть файл

@ -1,2 +1,3 @@
openButtonLabel=Open
chooseFileDialogTitle=Choose File
existingNavigatorWindow=Existing Navigator window