fix some ZoteroPane references

This commit is contained in:
Simon Kornblith 2011-01-30 09:52:51 +00:00
parent ecf0f3397c
commit 02efb56902
7 changed files with 19 additions and 26 deletions

View file

@ -152,11 +152,8 @@ var ZoteroAdvancedSearch = new function() {
return; return;
} }
if (lastWin.document.getElementById('zotero-pane').getAttribute('hidden') == 'true') { lastWin.ZoteroPane.show();
lastWin.ZoteroOverlay.toggleDisplay(); lastWin.ZoteroPane.getActiveZoteroPane.selectItem(item.getID(), false, true);
}
lastWin.ZoteroPane.selectItem(item.getID(), false, true);
lastWin.focus(); lastWin.focus();
} }
} }

View file

@ -317,15 +317,8 @@
return; return;
} }
if (lastWin.document.getElementById('zotero-pane').getAttribute('hidden') == 'true') { lastWin.ZoteroPane.show();
lastWin.ZoteroOverlay.toggleDisplay(); var zp = lastWin.ZoteroPane.getActiveZoteroPane();
// DEBUG: The actions below seem to crash Firefox 2.0.0.1 on OS X if
// the Z pane isn't already open, so we don't try
return;
}
var zp = lastWin.ZoteroPane;
} }
var parentID = this.item.getSource(); var parentID = this.item.getSource();

View file

@ -223,7 +223,7 @@
var p; var p;
if(window.ZoteroPane) if(window.ZoteroPane)
{ {
p = window.ZoteroPane; p = window.ZoteroPane.getActiveZoteroPane();
} }
else else
{ {
@ -242,10 +242,10 @@
return; return;
} }
p = win.ZoteroPane; p = win.ZoteroPane.getActiveZoteroPane();
} }
p.selectItem(id); if(p) p.selectItem(id);
} }
]]> ]]>
</body> </body>

View file

@ -153,8 +153,8 @@ var Zotero_Browser = new function() {
var libraryID, collectionID; var libraryID, collectionID;
var pane = ZoteroOverlay.getActiveZoteroPane(); var pane = ZoteroOverlay.getActiveZoteroPane();
if(pane) { if(pane) {
libraryID = ZoteroPane.getSelectedLibraryID(); libraryID = pane.getSelectedLibraryID();
collectionID = ZoteroPane.getSelectedCollection(true); collectionID = pane.getSelectedCollection(true);
} else { } else {
libraryID = collectionID = null; libraryID = collectionID = null;
} }

View file

@ -68,8 +68,9 @@ const Zotero_Lookup = new function () {
var libraryID = null; var libraryID = null;
var collection = false; var collection = false;
try { try {
libraryID = window.opener.ZoteroPane.getSelectedLibraryID(); var zp = window.opener.ZoteroPane.getActiveZoteroPane();
collection = window.opener.ZoteroPane.getSelectedCollection(); libraryID = zp.getSelectedLibraryID();
collection = zp.getSelectedCollection();
} catch(e) {} } catch(e) {}
translate.setHandler("itemDone", function(obj, item) { translate.setHandler("itemDone", function(obj, item) {
if(collection) collection.addItem(item.id); if(collection) collection.addItem(item.id);

View file

@ -703,8 +703,9 @@ Zotero.Connector.Translate.Save.prototype = {
this._libraryID = null; this._libraryID = null;
var collection = null; var collection = null;
try { try {
this._libraryID = win.ZoteroPane.getSelectedLibraryID(); var zp = win.ZoteroPane.getActiveZoteroPane();
collection = win.ZoteroPane.getSelectedCollection(); this._libraryID = zp.getSelectedLibraryID();
collection = zp.getSelectedCollection();
} catch(e) {} } catch(e) {}
var me = this; var me = this;
translate.setHandler("select", function(obj, item) { return me._selectItems(obj, item) }); translate.setHandler("select", function(obj, item) { return me._selectItems(obj, item) });

View file

@ -118,8 +118,9 @@ Zotero.MIMETypeHandler = new function () {
var libraryID = null; var libraryID = null;
var collection = null; var collection = null;
try { try {
libraryID = frontWindow.ZoteroPane.getSelectedLibraryID(); var zp = frontWindow.ZoteroPane.getActiveZoteroPane();
collection = frontWindow.ZoteroPane.getSelectedCollection(); libraryID = zp.getSelectedLibraryID();
collection = zp.getSelectedCollection();
} catch(e) {} } catch(e) {}
translation.setHandler("itemDone", function(obj, item) { frontWindow.Zotero_Browser.itemDone(obj, item, collection) }); translation.setHandler("itemDone", function(obj, item) { frontWindow.Zotero_Browser.itemDone(obj, item, collection) });
translation.setHandler("done", function(obj, item) { frontWindow.Zotero_Browser.finishScraping(obj, item, collection) }); translation.setHandler("done", function(obj, item) { frontWindow.Zotero_Browser.finishScraping(obj, item, collection) });