don't try to update keyElem when there is no open zotero key

This commit is contained in:
Simon Kornblith 2011-02-01 06:24:52 +00:00
parent 3bcd421f07
commit c107fcf18a

View file

@ -586,8 +586,8 @@ var Zotero = new function(){
// Initialize various services // Initialize various services
Zotero.Integration.init(); Zotero.Integration.init();
if(Zotero.Prefs.get("connector.enabled")) { if(Zotero.Prefs.get("httpServer.enabled")) {
Zotero.Connector.init(); Zotero.Server.init();
} }
Zotero.Zeroconf.init(); Zotero.Zeroconf.init();
@ -1747,15 +1747,17 @@ Zotero.Keys = new function() {
var useShift = Zotero.isMac; var useShift = Zotero.isMac;
// Zotero pane shortcut // Zotero pane shortcut
var zKey = Zotero.Prefs.get('keys.openZotero');
var keyElem = document.getElementById('key_openZotero'); var keyElem = document.getElementById('key_openZotero');
// Only override the default with the pref if the <key> hasn't been manually changed if(keyElem) {
// and the pref has been var zKey = Zotero.Prefs.get('keys.openZotero');
if (keyElem.getAttribute('key') == 'Z' && keyElem.getAttribute('modifiers') == 'accel alt' // Only override the default with the pref if the <key> hasn't been manually changed
&& (zKey != 'Z' || useShift)) { // and the pref has been
keyElem.setAttribute('key', zKey); if (keyElem.getAttribute('key') == 'Z' && keyElem.getAttribute('modifiers') == 'accel alt'
if (useShift) { && (zKey != 'Z' || useShift)) {
keyElem.setAttribute('modifiers', 'accel shift'); keyElem.setAttribute('key', zKey);
if (useShift) {
keyElem.setAttribute('modifiers', 'accel shift');
}
} }
} }