This commit is contained in:
Stephen Beaver 2016-02-19 14:26:48 -05:00
parent 44c30eb309
commit 2ccf2ede9e
3 changed files with 24 additions and 48 deletions

View File

@ -621,3 +621,27 @@ $('.container .panel-heading a[data-toggle="collapse"]').each(function (idx, el)
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
}
// --------------------------------------------------------------------------------------------
// Select every option in the specified multiselect
function AllServers(id, selectAll) {
for (i = 0; i < id.length; i++) {
id.eq(i).prop('selected', selectAll);
}
}
// Move all selected options from one multiselect to another
function moveOptions(From, To) {
var len = From.length;
var option;
if (len > 0) {
for (i=0; i<len; i++) {
if (From.eq(i).is(':selected')) {
option = From.eq(i).val();
value = From.eq(i).text();
To.append(new Option(value, option));
From.eq(i).remove();
}
}
}
}

View File

@ -477,30 +477,6 @@ print $form;
//<![CDATA[
events.push(function() {
// Select every option in the specified multiselect
function AllServers(id, selectAll) {
for (i = 0; i < id.length; i++) {
id.eq(i).prop('selected', selectAll);
}
}
// Move all selected options from one multiselect to another
function moveOptions(From, To) {
var len = From.length;
var option, value;
if (len > 1) {
for (i=0; i<len; i++) {
if (From.eq(i).is(':selected')) {
option = From.eq(i).val();
value = From.eq(i).text();
To.append(new Option(value, option));
From.eq(i).remove();
}
}
}
}
// Make buttons plain buttons, not submit
$("#movetodisabled").prop('type','button');
$("#movetoenabled").prop('type','button');

View File

@ -847,30 +847,6 @@ print $form;
//<![CDATA[
events.push(function() {
// Select every option in the specified multiselect
function AllServers(id, selectAll) {
for (i = 0; i < id.length; i++) {
id.eq(i).prop('selected', selectAll);
}
}
// Move all selected options from one multiselect to another
function moveOptions(From, To) {
var len = From.length;
var option;
if (len > 0) {
for (i=0; i<len; i++) {
if (From.eq(i).is(':selected')) {
option = From.eq(i).val();
value = From.eq(i).text();
To.append(new Option(value, option));
From.eq(i).remove();
}
}
}
}
// Make buttons plain buttons, not submit
$("#movetodisabled").prop('type','button');
$("#movetoenabled").prop('type','button');