diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-03-21 02:20:56 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-03-21 02:20:56 +0000 |
commit | 54830abd6b9462a4682daa838fba8dacb600f40a (patch) | |
tree | f4290113c3093fad7c79bfabb490b7df0d8680e1 /public/javascripts | |
parent | dd70327ce4d11d21382f1c9ac7de4c64c7f0bb7f (diff) | |
download | redmine-54830abd6b9462a4682daa838fba8dacb600f40a.tar.gz redmine-54830abd6b9462a4682daa838fba8dacb600f40a.zip |
Custom queries: buttons to move column to top and bottom (#16326).
git-svn-id: http://svn.redmine.org/redmine/trunk@12991 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public/javascripts')
-rw-r--r-- | public/javascripts/select_list_move.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/public/javascripts/select_list_move.js b/public/javascripts/select_list_move.js index 88496fd26..c3a5d0a2b 100644 --- a/public/javascripts/select_list_move.js +++ b/public/javascripts/select_list_move.js @@ -51,6 +51,17 @@ function moveOptionUp(theSel) { } } +function moveOptionTop(theSel) { + var index = theSel.selectedIndex; + + if (index > 0) { + for (i=index; i>0; i--) { + swapOptions(theSel, i-1, i); + } + theSel.selectedIndex = 0; + } +} + function moveOptionDown(theSel) { var index = theSel.selectedIndex; if (index < theSel.length - 1) { @@ -59,6 +70,17 @@ function moveOptionDown(theSel) { } } +function moveOptionBottom(theSel) { + var index = theSel.selectedIndex; + var indexTop = theSel.length - 1; + if (index < theSel.length - 1) { + for (i=index; i<indexTop; i++) { + swapOptions(theSel, i+1, i); + } + theSel.selectedIndex = indexTop; + } +} + // OK function selectAllOptions(id) { var select = $('#'+id); |