From 8aa278d48c18ce68ab3f2d95ce4fd9a5177bd77b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 6 Dec 2016 10:56:36 +0100 Subject: [PATCH] =?utf8?q?js/common.js:=20hash=20focus=20funktionalit?= =?utf8?q?=C3=A4t=20wiederhergestellt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/common.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/common.js b/js/common.js index 5f13ee056..e19f7f209 100644 --- a/js/common.js +++ b/js/common.js @@ -221,6 +221,20 @@ $(function () { } } + // all of this screws with the native location.hash focus, so reimplement this as well + if (location.hash) { + var hash_name = location.hash.substr(1); + var $hash_by_id = $(location.hash + ':visible'); + if ($hash_by_id.length > 0) { + $hash_by_id.get(0).focus(); + } else { + var $by_name = $('[name=' + hash_name + ']:visible'); + if ($by_name.length > 0) { + $by_name.get(0).focus(); + } + } + } + // legacy. sone forms install these if (typeof fokus == 'function') { fokus(); return; } if (focus_by_name('cursor_fokus')) return; -- 2.20.1