Optionales Fokus-Setzen via CSS-Klasse "initial_focus"
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 18 Jun 2013 10:01:07 +0000 (12:01 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 18 Jun 2013 10:01:07 +0000 (12:01 +0200)
js/common.js

index 8e3e5a1..71f1d31 100644 (file)
@@ -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;