Focus on first text input to skip hidden inputs

This commit is contained in:
Eric Allen 2009-10-30 15:02:42 -04:00
parent 7eb29194c3
commit 93c6151ca7
4 changed files with 7 additions and 7 deletions

View file

@ -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')}"

View file

@ -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')}"

View file

@ -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

View file

@ -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});