From 68f3da2c10aef7a8510abef4e0dded2015604b97 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 10 Jan 2012 19:51:01 -0500 Subject: [PATCH] Scroll row into view when tabbing through item/tags box Using a hack (focusing the proceeding row) for now. Not sure what's causing this. --- chrome/content/zotero/bindings/itembox.xml | 14 +++++++++++++- chrome/content/zotero/bindings/tagsbox.xml | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index d976e33ca..705d03f99 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -2345,7 +2345,19 @@ } next[0].click(); - this.ensureElementIsVisible(next[0]); + + // DEBUG: next[0] is always equal to the target element, + // but for some reason it's necessary to scroll to the next + // element when moving forward for the target element to + // be fully in view + if (!back && next[0].parentNode.nextSibling) { + var visElem = next[0].parentNode.nextSibling; + } + else { + var visElem = next[0]; + } + this.ensureElementIsVisible(visElem); + return true; ]]> diff --git a/chrome/content/zotero/bindings/tagsbox.xml b/chrome/content/zotero/bindings/tagsbox.xml index a859616cb..416078a95 100644 --- a/chrome/content/zotero/bindings/tagsbox.xml +++ b/chrome/content/zotero/bindings/tagsbox.xml @@ -652,7 +652,19 @@ } next[0].click(); - this.ensureElementIsVisible(next[0]); + + // DEBUG: next[0] is always equal to the target element, + // but for some reason it's necessary to scroll to the next + // element when moving forward for the target element to + // be fully in view + if (!back && next[0].parentNode.nextSibling) { + var visElem = next[0].parentNode.nextSibling; + } + else { + var visElem = next[0]; + } + this.ensureElementIsVisible(visElem); + return true; ]]>