From 49a8d68e60973b05b93c914fa8dd6dd4714b8f37 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 3 Oct 2006 19:09:21 +0000 Subject: [PATCH] Fixes #310, active focus remains with zotero pane closed Plus a couple JS strict warnings --- chrome/content/zotero/overlay.js | 4 ++++ chrome/content/zotero/overlay.xul | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 84aeb259ad..2158603df0 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -122,6 +122,7 @@ var ZoteroPane = new function() */ function toggleDisplay() { + // Visible == target visibility var visible = document.getElementById('zotero-pane').getAttribute('collapsed') == 'true'; document.getElementById('zotero-pane').setAttribute('collapsed',!visible); @@ -131,6 +132,9 @@ var ZoteroPane = new function() { document.getElementById('content').setAttribute('collapsed', false); document.getElementById('tb-fullscreen').setAttribute('fullscreenmode', false); + + // Return focus to the browser content pane + window.content.window.focus(); } } diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul index 7c8ac1af0d..9fa197d8f6 100644 --- a/chrome/content/zotero/overlay.xul +++ b/chrome/content/zotero/overlay.xul @@ -77,7 +77,7 @@ onselect="ZoteroPane.onCollectionSelected();" seltype="single" ondragdrop="nsDragAndDrop.drop(event,ZoteroPane.getCollectionsView())" ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ZoteroPane.getCollectionsView());" - onkeypress="if (event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ZoteroPane.deleteSelectedCollection(); return false; }" + onkeypress="if (event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ZoteroPane.deleteSelectedCollection(); }" flex="1">