select_list_move.js
29 lines
| 851 B
| application/javascript
|
JavascriptLexer
|
r11513 | function moveOptions(theSelFrom, theSelTo) { | ||
|
r13233 | $(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo)); | ||
|
r8979 | } | ||
function moveOptionUp(theSel) { | ||||
|
r13233 | $(theSel).find('option:selected').each(function(){ | ||
$(this).prev(':not(:selected)').detach().insertAfter($(this)); | ||||
}); | ||||
|
r8979 | } | ||
|
r12716 | function moveOptionTop(theSel) { | ||
|
r13233 | $(theSel).find('option:selected').detach().prependTo($(theSel)); | ||
|
r12716 | } | ||
|
r8979 | function moveOptionDown(theSel) { | ||
|
r13233 | $($(theSel).find('option:selected').get().reverse()).each(function(){ | ||
$(this).next(':not(:selected)').detach().insertBefore($(this)); | ||||
}); | ||||
|
r8979 | } | ||
|
r12716 | function moveOptionBottom(theSel) { | ||
|
r13233 | $(theSel).find('option:selected').detach().appendTo($(theSel)); | ||
|
r12716 | } | ||
|
r13234 | $(document).ready(function(){ | ||
$('.query-columns').closest('form').submit(function(){ | ||||
$('#selected_columns option').prop('selected', true); | ||||
}); | ||||
}); | ||||