зеркало из https://github.com/mozilla/gecko-dev.git
Fixed 'Current Navigator window' problems in OpenLocation dialog when used from Composer, b=91979, r=brade, sr=blake
This commit is contained in:
Родитель
ea747930fc
Коммит
b1f8acd519
|
@ -45,7 +45,19 @@ function onLoad()
|
||||||
if (!browser) {
|
if (!browser) {
|
||||||
// No browser supplied - we are calling from Composer
|
// No browser supplied - we are calling from Composer
|
||||||
dialog.openAppList.selectedItem = dialog.openEditWindow;
|
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 {
|
else {
|
||||||
dialog.openAppList.selectedItem = dialog.openTopWindow;
|
dialog.openAppList.selectedItem = dialog.openTopWindow;
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
openButtonLabel=Open
|
openButtonLabel=Open
|
||||||
chooseFileDialogTitle=Choose File
|
chooseFileDialogTitle=Choose File
|
||||||
|
existingNavigatorWindow=Existing Navigator window
|
||||||
|
|
Загрузка…
Ссылка в новой задаче