Only get the most recent window in ZoteroPane.loadURI() if we need to

This commit is contained in:
Dan Stillman 2007-03-24 17:28:02 +00:00
parent 9bc8583703
commit 8a9da660fd

View File

@ -1321,12 +1321,12 @@ var ZoteroPane = new function()
window.open(uri, "zotero-loaded-page",
"menubar=yes,location=yes,toolbar=yes,personalbar=yes,resizable=yes,scrollbars=yes,status=yes");
if (data && data.attachmentID) {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var newWindow = wm.getMostRecentWindow("navigator:browser");
var browser = newWindow.getBrowser();
//var browser = newWindow.getBrowser();
if (data && data.attachmentID) {
newWindow.Zotero_Browser.annotatePage(data.attachmentID);
// In case the page has already loaded, update
newWindow.Zotero_Browser.updateStatus();