From d444d80f93ec4651a42841867063d311d78c6c3d Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Sun, 8 May 2011 16:40:31 +0200 Subject: [PATCH] fix #1168 by using a new helper to increate the tab_index automatically Signed-off-by: Reinier Balt --- app/helpers/todos_helper.rb | 11 ++- app/views/contexts/_context_form.rhtml | 6 +- app/views/contexts/_new_context_form.rhtml | 5 +- app/views/projects/_new_project_form.rhtml | 11 ++- app/views/projects/_project_form.rhtml | 12 +-- app/views/recurring_todos/_edit_form.html.erb | 95 +++++++++---------- .../recurring_todos/_recurring_todo_form.erb | 79 +++++++-------- app/views/shared/_add_new_item_form.rhtml | 1 + app/views/todos/_edit_form.rhtml | 18 ++-- app/views/todos/_new_multi_todo_form.rhtml | 10 +- app/views/todos/_new_todo_form.rhtml | 18 ++-- 11 files changed, 139 insertions(+), 127 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 5c846752..05e68079 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -411,7 +411,16 @@ module TodosHelper html += "}}) " * animation.size return html + ";" end - + + def reset_tab_index + $tracks_tab_index = 0 + end + + def next_tab_index + $tracks_tab_index = $tracks_tab_index + 1 + return $tracks_tab_index + end + private def image_tag_for_star(todo) diff --git a/app/views/contexts/_context_form.rhtml b/app/views/contexts/_context_form.rhtml index 952e8a44..92bd39aa 100644 --- a/app/views/contexts/_context_form.rhtml +++ b/app/views/contexts/_context_form.rhtml @@ -12,15 +12,15 @@
- <%= text_field('context', 'name', :class => 'context-name') %>
+ <%= text_field('context', 'name', :class => 'context-name', :tabindex => next_tab_index) %>
- <%= check_box('context', 'hide', :class => 'context-hide') %> + <%= check_box('context', 'hide', {:class => 'context-hide', :tabindex => next_tab_index}) %>
- diff --git a/app/views/contexts/_new_context_form.rhtml b/app/views/contexts/_new_context_form.rhtml index 26bde0ba..26d65348 100644 --- a/app/views/contexts/_new_context_form.rhtml +++ b/app/views/contexts/_new_context_form.rhtml @@ -1,3 +1,4 @@ +<%- reset_tab_index %>