1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-01 13:19:39 +00:00
redmine/public/javascripts/select_list_move.js
Jean-Philippe Lang 8b6939e2f4 Rewritten select_list_move.js functions with JQuery.
git-svn-id: http://svn.redmine.org/redmine/trunk@13615 e93f8b46-1217-0410-a6f0-8f06a7374b81
2014-11-18 21:44:45 +00:00

28 lines
781 B
JavaScript

function moveOptions(theSelFrom, theSelTo) {
$(theSelFrom).find('option:selected').detach().prop("selected", false).appendTo($(theSelTo));
}
function moveOptionUp(theSel) {
$(theSel).find('option:selected').each(function(){
$(this).prev(':not(:selected)').detach().insertAfter($(this));
});
}
function moveOptionTop(theSel) {
$(theSel).find('option:selected').detach().prependTo($(theSel));
}
function moveOptionDown(theSel) {
$($(theSel).find('option:selected').get().reverse()).each(function(){
$(this).next(':not(:selected)').detach().insertBefore($(this));
});
}
function moveOptionBottom(theSel) {
$(theSel).find('option:selected').detach().appendTo($(theSel));
}
function selectAllOptions(id) {
$('#'+id).find('option').prop('selected', true);
}