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; ]]>