@@ -23,8 +23,10 | |||
|
23 | 23 | :ondblclick => "moveOptions(this.form.selected_columns, this.form.available_columns);" %> |
|
24 | 24 | </td> |
|
25 | 25 | <td class="buttons"> |
|
26 | <input type="button" value="⇈" onclick="moveOptionTop(this.form.selected_columns);" /><br /> | |
|
26 | 27 | <input type="button" value="↑" onclick="moveOptionUp(this.form.selected_columns);" /><br /> |
|
27 | <input type="button" value="↓" onclick="moveOptionDown(this.form.selected_columns);" /> | |
|
28 | <input type="button" value="↓" onclick="moveOptionDown(this.form.selected_columns);" /><br /> | |
|
29 | <input type="button" value="⇊" onclick="moveOptionBottom(this.form.selected_columns);" /> | |
|
28 | 30 | </td> |
|
29 | 31 | </tr> |
|
30 | 32 | </table> |
@@ -51,6 +51,17 function moveOptionUp(theSel) { | |||
|
51 | 51 | } |
|
52 | 52 | } |
|
53 | 53 | |
|
54 | function moveOptionTop(theSel) { | |
|
55 | var index = theSel.selectedIndex; | |
|
56 | ||
|
57 | if (index > 0) { | |
|
58 | for (i=index; i>0; i--) { | |
|
59 | swapOptions(theSel, i-1, i); | |
|
60 | } | |
|
61 | theSel.selectedIndex = 0; | |
|
62 | } | |
|
63 | } | |
|
64 | ||
|
54 | 65 | function moveOptionDown(theSel) { |
|
55 | 66 | var index = theSel.selectedIndex; |
|
56 | 67 | if (index < theSel.length - 1) { |
@@ -59,6 +70,17 function moveOptionDown(theSel) { | |||
|
59 | 70 | } |
|
60 | 71 | } |
|
61 | 72 | |
|
73 | function moveOptionBottom(theSel) { | |
|
74 | var index = theSel.selectedIndex; | |
|
75 | var indexTop = theSel.length - 1; | |
|
76 | if (index < theSel.length - 1) { | |
|
77 | for (i=index; i<indexTop; i++) { | |
|
78 | swapOptions(theSel, i+1, i); | |
|
79 | } | |
|
80 | theSel.selectedIndex = indexTop; | |
|
81 | } | |
|
82 | } | |
|
83 | ||
|
62 | 84 | // OK |
|
63 | 85 | function selectAllOptions(id) { |
|
64 | 86 | var select = $('#'+id); |
General Comments 0
You need to be logged in to leave comments.
Login now