]> source.dussan.org Git - redmine.git/commitdiff
Moved select_list_move.js content to application.js.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 18 Nov 2014 22:14:34 +0000 (22:14 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 18 Nov 2014 22:14:34 +0000 (22:14 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13618 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/queries/_columns.html.erb
public/javascripts/application.js
public/javascripts/select_list_move.js [deleted file]

index 595a96b146a24719367ef6ddf3cc7743ee50c026..d102341c12ac39f4fb7c0f26b60193e3c1eda3ff 100644 (file)
   </tr>
 </table>
 
-<% content_for :header_tags do %>
-<%= javascript_include_tag 'select_list_move' %>
+<%= javascript_tag do %>
+$(document).ready(function(){
+  $('.query-columns').closest('form').submit(function(){
+    $('#selected_columns option').prop('selected', true);
+  });
+});
 <% end %>
index 19104fdc2bfd7c2d1a352999ba08ec88ad5b4199..e598bbcafb215ac1d39e2d8b15bae7acbec2f6c3 100644 (file)
@@ -74,6 +74,31 @@ function hideFieldset(el) {
   fieldset.children('div').hide();
 }
 
+// columns selection
+function moveOptions(theSelFrom, theSelTo) {
+  $(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo));
+}
+
+function moveOptionUp(theSel) {
+  $(theSel).find('option:selected').each(function(){
+    $(this).prev(':not(:selected)').detach().insertAfter($(this));
+  });
+}
+
+function moveOptionTop(theSel) {
+  $(theSel).find('option:selected').detach().prependTo($(theSel));
+}
+
+function moveOptionDown(theSel) {
+  $($(theSel).find('option:selected').get().reverse()).each(function(){
+    $(this).next(':not(:selected)').detach().insertBefore($(this));
+  });
+}
+
+function moveOptionBottom(theSel) {
+  $(theSel).find('option:selected').detach().appendTo($(theSel));
+}
+
 function initFilters() {
   $('#add_filter_select').change(function() {
     addFilter($(this).val(), '', []);
diff --git a/public/javascripts/select_list_move.js b/public/javascripts/select_list_move.js
deleted file mode 100644 (file)
index db05854..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-function moveOptions(theSelFrom, theSelTo) {
-  $(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo));
-}
-
-function moveOptionUp(theSel) {
-  $(theSel).find('option:selected').each(function(){
-    $(this).prev(':not(:selected)').detach().insertAfter($(this));
-  });
-}
-
-function moveOptionTop(theSel) {
-  $(theSel).find('option:selected').detach().prependTo($(theSel));
-}
-
-function moveOptionDown(theSel) {
-  $($(theSel).find('option:selected').get().reverse()).each(function(){
-    $(this).next(':not(:selected)').detach().insertBefore($(this));
-  });
-}
-
-function moveOptionBottom(theSel) {
-  $(theSel).find('option:selected').detach().appendTo($(theSel));
-}
-
-$(document).ready(function(){
-  $('.query-columns').closest('form').submit(function(){
-    $('#selected_columns option').prop('selected', true);
-  });
-});