closes #1797, Toggle tab mode button when no non-Zotero tabs are open

clicking the toggle tab button when the Zotero tab is the only tab open will now open the home page
This commit is contained in:
Simon Kornblith 2011-05-19 23:20:07 +00:00
parent bc354b1435
commit de56c2567f

View file

@ -306,8 +306,10 @@ var ZoteroOverlay = new function()
window.zoteroSavedCollectionSelection = ZoteroPane.collectionsView.saveSelection();
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 ? gBrowser.tabs : gBrowser.mTabs).length === 1) return;
// if Zotero tab is the only tab, open the home page in a new tab
if((gBrowser.tabs ? gBrowser.tabs : gBrowser.mTabs).length === 1) {
gBrowser.addTab(gBrowser.homePage);
}
// swap ZoteroPane object
ZoteroPane = ZoteroPane_Overlay;