From 1cf88c30e7b6bd496be16f096974144e9bf3df84 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 21 Dec 2006 08:40:31 +0000 Subject: [PATCH] Fixes #461, tab bugs --- chrome/content/zotero/itemPane.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js index 26e27a8c1..205c0d5a2 100644 --- a/chrome/content/zotero/itemPane.js +++ b/chrome/content/zotero/itemPane.js @@ -1028,15 +1028,26 @@ var ZoteroItemPane = new function() if (row == row.parentNode.lastChild) { _tabDirection = 1; + var lastTag = true; } } target.blur(); + + // Return focus to items pane + if (!lastTag) { + document.getElementById('zotero-items-tree').focus(); + } + return false; case event.DOM_VK_ESCAPE: // Reset field to original value target.value = target.getAttribute('value'); target.blur(); + + // Return focus to items pane + document.getElementById('zotero-items-tree').focus(); + return false; case event.DOM_VK_TAB: @@ -1199,11 +1210,6 @@ var ZoteroItemPane = new function() } _focusNextField(focusMode, focusBox, _lastTabIndex, _tabDirection==-1); } - // If not tab and not new tag, return focus to items pane - // DEBUG: is this the best place for this? - else if (focusMode != 'tags') { - document.getElementById('zotero-items-tree').focus(); - } } function modifyField(field, value)