From: Jean-Philippe Lang Date: Tue, 18 Nov 2014 21:53:25 +0000 (+0000) Subject: Use an handler instead of onsubmit attribute. X-Git-Tag: 3.0.0~358 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ff0a91d97da0412a6b1c1b10de3858b13c3b5201;p=redmine.git Use an handler instead of onsubmit attribute. git-svn-id: http://svn.redmine.org/redmine/trunk@13616 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/queries/edit.html.erb b/app/views/queries/edit.html.erb index a1534f82d..eba719fa1 100644 --- a/app/views/queries/edit.html.erb +++ b/app/views/queries/edit.html.erb @@ -1,6 +1,6 @@

<%= l(:label_query) %>

-<%= form_tag(query_path(@query), :onsubmit => 'selectAllOptions("selected_columns");', :method => :put) do %> +<%= form_tag(query_path(@query), :method => :put) do %> <%= render :partial => 'form', :locals => {:query => @query} %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/queries/new.html.erb b/app/views/queries/new.html.erb index 7081eee24..3c1ff3b1c 100644 --- a/app/views/queries/new.html.erb +++ b/app/views/queries/new.html.erb @@ -1,6 +1,6 @@

<%= l(:label_query_new) %>

-<%= form_tag(@project ? project_queries_path(@project) : queries_path, :onsubmit => 'selectAllOptions("selected_columns");') do %> +<%= form_tag(@project ? project_queries_path(@project) : queries_path) do %> <%= render :partial => 'form', :locals => {:query => @query} %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/settings/_issues.html.erb b/app/views/settings/_issues.html.erb index 83b4acd98..fac6d6dea 100644 --- a/app/views/settings/_issues.html.erb +++ b/app/views/settings/_issues.html.erb @@ -1,4 +1,4 @@ -<%= form_tag({:action => 'edit', :tab => 'issues'}, :onsubmit => 'selectAllOptions("selected_columns");') do %> +<%= form_tag({:action => 'edit', :tab => 'issues'}) do %>

<%= setting_check_box :cross_project_issue_relations %>

diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 38193b8a0..1577da6b8 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -288,7 +288,6 @@ function toggleMultiSelect(el) { } function submit_query_form(id) { - selectAllOptions("selected_columns"); $('#'+id).submit(); } diff --git a/public/javascripts/select_list_move.js b/public/javascripts/select_list_move.js index d542ac624..db0585424 100644 --- a/public/javascripts/select_list_move.js +++ b/public/javascripts/select_list_move.js @@ -22,6 +22,8 @@ function moveOptionBottom(theSel) { $(theSel).find('option:selected').detach().appendTo($(theSel)); } -function selectAllOptions(id) { - $('#'+id).find('option').prop('selected', true); -} +$(document).ready(function(){ + $('.query-columns').closest('form').submit(function(){ + $('#selected_columns option').prop('selected', true); + }); +});