From f01bd86ca0a45deb162f9dc1d0a99c87d325dc03 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 1 Oct 2007 20:22:27 +0000 Subject: [PATCH] ActionItem85: fixing the focus on first field to skip search_box_form --- app/views/layouts/application.rhtml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index 91f00ac..40e35d4 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -20,6 +20,17 @@ apply_source_formatting : true, language: <%= language.inspect %>, }); + + function focusOnFirstField() { + var form = document.forms[0]; + if (form.id == 'search_box_form') { + form = document.forms[1]; + } + if (form != null && form.elements[0] != null) { + form.elements[0].focus(); + } + } + <%= design_all_header_tags %> @@ -34,7 +45,7 @@ - + <% unless flash[:notice].nil? %>
@@ -62,8 +73,8 @@ -- libgit2 0.21.2