зеркало из https://github.com/mozilla/pjs.git
Fixed 'Current Navigator window' problems in OpenLocation dialog when used from Composer, b=91979, r=brade, sr=blake
This commit is contained in:
Родитель
0f760c74f6
Коммит
81ea4499fa
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче