From: Moritz Bunkus Date: Tue, 18 Jun 2013 10:01:07 +0000 (+0200) Subject: Optionales Fokus-Setzen via CSS-Klasse "initial_focus" X-Git-Tag: release-3.1.0beta1~309^2~7 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e92b111df5e022e68517682cf48ab5f73adc9e79;p=kivitendo-erp.git Optionales Fokus-Setzen via CSS-Klasse "initial_focus" --- diff --git a/js/common.js b/js/common.js index 8e3e5a120..71f1d3104 100644 --- a/js/common.js +++ b/js/common.js @@ -192,6 +192,11 @@ $(document).ready(function () { $('input').focus(function(){ if (focussable(this)) window.focused_element = this; }); + + var initial_focus = $(".initial_focus").filter(':visible')[0]; + if (initial_focus) + $(initial_focus).focus(); + // legacy. sone forms install these if (typeof fokus == 'function') { fokus(); return; } if (focus_by_name('cursor_fokus')) return;