From: Sven Schöling Date: Tue, 6 Dec 2016 12:47:20 +0000 (+0100) Subject: focus: scroll to active element X-Git-Tag: release-3.5.4~1764 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=fdc625b4d1ba26782ff81ec2d79c1b533f26a9a7;p=kivitendo-erp.git focus: scroll to active element --- diff --git a/js/common.js b/js/common.js index e19f7f209..84e0b26dc 100644 --- a/js/common.js +++ b/js/common.js @@ -235,6 +235,10 @@ $(function () { } } + // scroll to the active element. jQuery.focus doesn't do this + // TODO: find out how to reliably frame the active element + window.scrollTo(0, document.activeElement.getBoundingClientRect().top); + // legacy. sone forms install these if (typeof fokus == 'function') { fokus(); return; } if (focus_by_name('cursor_fokus')) return;