let toggleTab() take an explicit mode argument

This commit is contained in:
Simon Kornblith 2011-02-03 07:20:02 +00:00
parent 90b7380563
commit e26b292324

View File

@ -302,9 +302,10 @@ var ZoteroOverlay = new function()
/**
* Toggle between Zotero as a tab and Zotero as a pane
*/
this.toggleTab = function() {
this.toggleTab = function(setMode) {
var tab = this.findZoteroTab();
if(tab) { // Zotero is running in a tab
if(setMode) return;
// don't do anything if Zotero tab is the only tab
if(tab && gBrowser.tabs.length === 1) return;
@ -316,6 +317,7 @@ var ZoteroOverlay = new function()
this.isTab = false;
this.toggleDisplay();
} else { // Zotero is running in the pane
if(setMode === false) return;
// close Zotero pane
this.toggleDisplay();