select_list_move.js
27 lines
| 781 B
| application/javascript
|
JavascriptLexer
|
r11513 | function moveOptions(theSelFrom, theSelTo) { | ||
|
r13487 | $(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo)); | ||
|
r8979 | } | ||
function moveOptionUp(theSel) { | ||||
|
r13487 | $(theSel).find('option:selected').each(function(){ | ||
$(this).prev(':not(:selected)').detach().insertAfter($(this)); | ||||
}); | ||||
|
r8979 | } | ||
|
r12716 | function moveOptionTop(theSel) { | ||
|
r13487 | $(theSel).find('option:selected').detach().prependTo($(theSel)); | ||
|
r12716 | } | ||
|
r8979 | function moveOptionDown(theSel) { | ||
|
r13487 | $($(theSel).find('option:selected').get().reverse()).each(function(){ | ||
$(this).next(':not(:selected)').detach().insertBefore($(this)); | ||||
}); | ||||
|
r8979 | } | ||
|
r12716 | function moveOptionBottom(theSel) { | ||
|
r13487 | $(theSel).find('option:selected').detach().appendTo($(theSel)); | ||
|
r12716 | } | ||
|
r11513 | function selectAllOptions(id) { | ||
|
r13487 | $('#'+id).find('option').prop('selected', true); | ||
|
r8979 | } | ||