##// END OF EJS Templates
Focus first text field automatically (#13134)....
Jean-Philippe Lang -
r12395:bacc2508161a
parent child
Show More
@@ -44,8 +44,6
44 <%= submit_tag l(:button_create) %>
44 <%= submit_tag l(:button_create) %>
45 <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
45 <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
46 <%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form' %>
46 <%= preview_link preview_new_issue_path(:project_id => @project), 'issue-form' %>
47
48 <%= javascript_tag "$('#issue_subject').focus();" %>
49 <% end %>
47 <% end %>
50
48
51 <div id="preview" class="wiki"></div>
49 <div id="preview" class="wiki"></div>
@@ -22,5 +22,3
22 <%= render :partial => 'sidebar' %>
22 <%= render :partial => 'sidebar' %>
23 <% end %>
23 <% end %>
24 <% end %>
24 <% end %>
25
26 <%= javascript_tag "$('#password').focus();" %>
@@ -4,5 +4,4
4 <%= render :partial => 'form', :locals => { :f => f } %>
4 <%= render :partial => 'form', :locals => { :f => f } %>
5 <%= submit_tag l(:button_create) %>
5 <%= submit_tag l(:button_create) %>
6 <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
6 <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
7 <%= javascript_tag "$('#project_name').focus();" %>
8 <% end %>
7 <% end %>
@@ -4,7 +4,6
4 <%= form_tag({}, :method => :get, :id => 'search-form') do %>
4 <%= form_tag({}, :method => :get, :id => 'search-form') do %>
5 <%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %>
5 <%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %>
6 <p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
6 <p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
7 <%= javascript_tag "$('#search-input').focus()" %>
8 <%= project_select_tag %>
7 <%= project_select_tag %>
9 <%= hidden_field_tag 'all_words', '', :id => nil %>
8 <%= hidden_field_tag 'all_words', '', :id => nil %>
10 <label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
9 <label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
@@ -583,6 +583,12 function addFormObserversForDoubleSubmit() {
583 });
583 });
584 }
584 }
585
585
586 function defaultFocus(){
587 if ($('#content :focus').length == 0) {
588 $('#content input[type=text], #content textarea').first().focus();
589 }
590 }
591
586 function blockEventPropagation(event) {
592 function blockEventPropagation(event) {
587 event.stopPropagation();
593 event.stopPropagation();
588 event.preventDefault();
594 event.preventDefault();
@@ -604,4 +610,5 $(document).ready(function(){
604 $(document).ready(setupAjaxIndicator);
610 $(document).ready(setupAjaxIndicator);
605 $(document).ready(hideOnLoad);
611 $(document).ready(hideOnLoad);
606 $(document).ready(addFormObserversForDoubleSubmit);
612 $(document).ready(addFormObserversForDoubleSubmit);
613 $(document).ready(defaultFocus);
607
614
General Comments 0
You need to be logged in to leave comments. Login now