summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-03-29 14:38:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-03-29 14:38:11 +0000
commit33a7f6bc1179b3f96e4479c821d39ba708448626 (patch)
treeb7a5db7ea416ae647cb2ecc864fc0688407b02ee
parent65c9223fe5554c147e50050308ab60510ce1c40c (diff)
downloadredmine-33a7f6bc1179b3f96e4479c821d39ba708448626.tar.gz
redmine-33a7f6bc1179b3f96e4479c821d39ba708448626.zip
Merged r12990 and r12991 (#16326).
git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13023 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/queries/_columns.html.erb4
-rw-r--r--public/javascripts/select_list_move.js22
-rw-r--r--public/stylesheets/application.css1
3 files changed, 26 insertions, 1 deletions
diff --git a/app/views/queries/_columns.html.erb b/app/views/queries/_columns.html.erb
index 0d624d989..595a96b14 100644
--- a/app/views/queries/_columns.html.erb
+++ b/app/views/queries/_columns.html.erb
@@ -23,8 +23,10 @@
:ondblclick => "moveOptions(this.form.selected_columns, this.form.available_columns);" %>
</td>
<td class="buttons">
+ <input type="button" value="&#8648;" onclick="moveOptionTop(this.form.selected_columns);" /><br />
<input type="button" value="&#8593;" onclick="moveOptionUp(this.form.selected_columns);" /><br />
- <input type="button" value="&#8595;" onclick="moveOptionDown(this.form.selected_columns);" />
+ <input type="button" value="&#8595;" onclick="moveOptionDown(this.form.selected_columns);" /><br />
+ <input type="button" value="&#8650;" onclick="moveOptionBottom(this.form.selected_columns);" />
</td>
</tr>
</table>
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);
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index cb5ebe371..e04b4b26d 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -263,6 +263,7 @@ table.query-columns td.buttons {
vertical-align: middle;
text-align: center;
}
+table.query-columns td.buttons input[type=button] {width:35px;}
td.center {text-align:center;}