VRFS-705 fix issue with input disappearing

This commit is contained in:
Brian Smith 2013-10-13 21:01:44 -04:00
parent e0cfe9cb6e
commit ecd247c1f7
1 changed files with 5 additions and 3 deletions

View File

@ -273,17 +273,17 @@
}
function isChatInput(id) {
// copy the arrays since $.grep modifies them
// copy the arrays
var chatOtherUnassignedListCopy = chatOtherUnassignedList;
var chatOtherAssignedListCopy = chatOtherAssignedList;
// is this input in the unassigned list?
$.grep(chatOtherUnassignedListCopy, function(n,i){
chatOtherUnassignedListCopy = $.grep(chatOtherUnassignedListCopy, function(n,i){
return n.chat && n.id === id;
});
// is this input in the assigned list?
$.grep(chatOtherAssignedListCopy, function(n,i){
chatOtherAssignedListCopy = $.grep(chatOtherAssignedListCopy, function(n,i){
return n.chat && n.id === id;
});
@ -332,6 +332,7 @@
// add each unused music input if it doesn't already exist
$('#audio-inputs-unused > option').each(function() {
if ($('#voice-inputs-unused > option[value="' + this.value + '"]').length === 0) {
logger.debug("Appending " + this.value + " to the unused voice input box.");
$('#voice-inputs-unused').append('<option value="' + this.value + '">' + this.text + '</option>');
}
});
@ -343,6 +344,7 @@
// if this input is not already in the available music inputs box and the selected input is not chat input, add
// it to the unused music inputs box
if ($('#audio-inputs-unused > option[value="' + this.value + '"]').length === 0 && !isChatInput(this.value)) {
logger.debug("Appending " + this.value + " to the unused audio input box.");
$('#audio-inputs-unused').append('<option value="' + this.value + '">' + this.text + '</option>');
}
});