www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 520a2b061c1a1ea44dd298f3c7ba35900b3e1b46
parent 87c47c0615bc84f0e92ef37e817277a9cf2acc2d
Author: Will S <terribleangel@gmail.com>
Date:   Tue, 27 Dec 2011 09:06:50 -0500

Select appropriate tag when moving from changed tag using enter or tab (not for mouse click)

Diffstat:
Mchrome/content/zotero/bindings/tagsbox.xml | 25++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/bindings/tagsbox.xml b/chrome/content/zotero/bindings/tagsbox.xml @@ -438,18 +438,29 @@ // when the notifier kicks in var existing = Zotero.Tags.getID(value, 0); if (existing && id != existing) { - this._tabDirection = false; + // this._tabDirection = false; } + var origTagIndex = this.item.getTagIndex(id); var changed = tagsbox.replace(id, value); if (changed) { - return; + var newTagIndex = this.item.getTagIndex(changed); + if (newTagIndex>origTagIndex) { + if (this._tabDirection == 1) { + this._lastTabIndex--; + } + } + else if (newTagIndex<origTagIndex) { + if (this._tabDirection == -1) { + this._lastTabIndex++; + } + } + } + else if (value != Zotero.Tags.getName(id)) { + if (this._tabDirection == 1) { + this._lastTabIndex -= 1; + } } } - else { - tagsbox.remove(id); - return; - } - } // New tag else { //Check for newlines or carriage returns used as delimiters