Don't try to icon guidance on initialization failure

This commit is contained in:
Simon Kornblith 2014-04-28 20:42:43 -04:00
parent 6c74d670d1
commit 5814bdcd84

View file

@ -110,6 +110,20 @@ var ZoteroOverlay = new function()
document.persist(toolbar.id, "currentset");
}
}
if (icon.getAttribute("cui-areatype") == "toolbar") {
window.setTimeout(function() {
var isUpgrade = false;
try {
isUpgrade = Zotero.Prefs.get("firstRunGuidanceShown.saveIcon");
} catch(e) {}
var property = "firstRunGuidance.toolbarButton."+(isUpgrade ? "upgrade" : "new");
var shortcut = Zotero.getString(Zotero.isMac ? "general.keys.cmdShift" : "general.keys.ctrlShift")+
Zotero.Prefs.get("keys.openZotero");
document.getElementById("zotero-toolbar-button-guidance").show(null, Zotero.getString(property, shortcut));
}, 0);
}
}
}
else {
@ -134,20 +148,6 @@ var ZoteroOverlay = new function()
icon.setAttribute('tooltiptext', errMsg);
icon.setAttribute('error', 'true');
}
if (icon.getAttribute("cui-areatype") == "toolbar") {
window.setTimeout(function() {
var isUpgrade = false;
try {
isUpgrade = Zotero.Prefs.get("firstRunGuidanceShown.saveIcon");
} catch(e) {}
var property = "firstRunGuidance.toolbarButton."+(isUpgrade ? "upgrade" : "new");
var shortcut = Zotero.getString(Zotero.isMac ? "general.keys.cmdShift" : "general.keys.ctrlShift")+
Zotero.Prefs.get("keys.openZotero");
document.getElementById("zotero-toolbar-button-guidance").show(null, Zotero.getString(property, shortcut));
}, 0);
}
// Used for loading pages from upgrade wizard
if (Zotero && Zotero.initialURL) {