diff --git a/app/views/contexts/create.js.rjs b/app/views/contexts/create.js.rjs index 1d5e6f9f..a4755f81 100644 --- a/app/views/contexts/create.js.rjs +++ b/app/views/contexts/create.js.rjs @@ -5,7 +5,7 @@ if @saved page.hide 'status' page['badge_count'].replace_html @down_count page << '$("#context-form").clearForm();' - page << '$("#context-form input:first").focus();' + page << '$("#context-form input:text:first").focus();' else page.show 'status' page.replace_html 'status', "#{error_messages_for('context')}" diff --git a/app/views/projects/create.js.rjs b/app/views/projects/create.js.rjs index c51d36e9..0341fc8b 100644 --- a/app/views/projects/create.js.rjs +++ b/app/views/projects/create.js.rjs @@ -9,7 +9,7 @@ elsif @saved page.insert_html :bottom, "list-active-projects", :partial => 'project_listing', :locals => { :project_listing => @project } page.sortable "list-active-projects", get_listing_sortable_options('list-active-projects') page << "$('#project-form').clearForm();" - page << "$('#project-form input:first').focus();" + page << "$('#project-form input:text:first').focus();" else page.show 'status' page.replace_html 'status', "#{error_messages_for('project')}" diff --git a/app/views/todos/create.js.rjs b/app/views/todos/create.js.rjs index b63b6168..b82a7b24 100644 --- a/app/views/todos/create.js.rjs +++ b/app/views/todos/create.js.rjs @@ -6,7 +6,7 @@ if @saved status_message = 'Added new context / ' + status_message if @new_context_created page.notify :notice, status_message, 5.0 page['badge_count'].replace_html @down_count - page.send :record, "$('#todo-form-new-action').clearForm();$('#todo-form-new-action input:first').focus();" + page.send :record, "$('#todo-form-new-action').clearForm();$('#todo-form-new-action input:text:first').focus();" page['todo_context_name'].value = @initial_context_name page['todo_project_name'].value = @initial_project_name page['tag_list'].value = @default_tags diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 8a8e60d9..07d4cc41 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -9,7 +9,7 @@ var TracksForm = { } else { toggleLink.text(hideLinkText).attr('title', hideLinkTitle); - $('#'+formId+' input:first').focus(); + $('#'+formId+' input:text:first').focus(); } toggleDiv.toggleClass('hide_form'); }, @@ -317,7 +317,7 @@ $(document).ready(function() { $("#recurring_todo_new_action_cancel").click(function(){ $('#recurring-todo-form-new-action').clearForm(); - $('#recurring-todo-form-new-action input:first').focus(); + $('#recurring-todo-form-new-action input:text:first').focus(); TracksForm.hide_all_recurring(); $('#recurring_daily').show(); TracksForm.toggle_overlay(); @@ -325,7 +325,7 @@ $(document).ready(function() { $("#recurring_todo_edit_action_cancel").live('click', function(){ $('#recurring-todo-form-edit-action').clearForm(); - $('#recurring-todo-form-edit-action input:first').focus(); + $('#recurring-todo-form-edit-action input:text:first').focus(); TracksForm.hide_all_recurring(); $('#recurring_daily').show(); TracksForm.toggle_overlay(); @@ -402,7 +402,7 @@ $(document).ready(function() { $(".add_note_link a").live('click', function(){ $('#new-note').show(); $('#new-note form').clearForm(); - $('#new-note form input:first').focus(); + $('#new-note form input:text:first').focus(); }); $("#list-active-projects").sortable({handle: '.handle', update: update_order});