From 68b68872e1b19efa200c7135fc6ef523844e753f Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 8 Sep 2013 19:57:38 -0400 Subject: [PATCH] VRFS-633 bug fixes --- app/assets/javascripts/configureTrack.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/configureTrack.js b/app/assets/javascripts/configureTrack.js index a1e1f0ada..0750e80aa 100644 --- a/app/assets/javascripts/configureTrack.js +++ b/app/assets/javascripts/configureTrack.js @@ -105,12 +105,11 @@ } }); - var $unusedMusicInputs = $('#audio-inputs-unused > option:selected'); - // Track 1 Add var $imgTrack1Add = $('#img-track1-input-add'); $imgTrack1Add.unbind("click"); $imgTrack1Add.click(function() { + var $unusedMusicInputs = $('#audio-inputs-unused > option:selected'); _handleTrackInputAdd($unusedMusicInputs, '#track1-input'); }); @@ -118,6 +117,7 @@ var $imgTrack2Add = $('#img-track2-input-add'); $imgTrack2Add.unbind("click"); $imgTrack2Add.click(function() { + var $unusedMusicInputs = $('#audio-inputs-unused > option:selected'); _handleTrackInputAdd($unusedMusicInputs, '#track2-input'); }); @@ -274,26 +274,33 @@ } function voiceChatChanged() { - var voiceChatVal = $('#voice-chat-type').val(); if (voiceChatVal == VOICE_CHAT.NO_CHAT) { _addSelectedVoiceInputsToMusicInputs(); + $('#voice-inputs-unused').empty(); $('#voice-inputs-selection').empty(); } else if (voiceChatVal == VOICE_CHAT.CHAT) { + $('#voice-inputs-unused').empty(); + $('#voice-inputs-selection').empty(); + context.JK.loadOptions($('#template-option').html(), $('#voice-inputs-unused'), chatOtherUnassignedList, "id", "name", -1); context.JK.loadOptions($('#template-option').html(), $('#voice-inputs-selection'), chatOtherAssignedList, "id", "name", -1); } else if (voiceChatVal == VOICE_CHAT.SESSION) { + $('#voice-inputs-unused').empty(); + $('#voice-inputs-selection').empty(); + $('#audio-inputs-unused').each(function(key, value) { if ($('#voice-inputs-unused > option[value="' + key + '"]').length === 0) { - $('#voice-inputs-unused').append($(''); } }); } else if (voiceChatVal == VOICE_CHAT.MIC) { _addSelectedVoiceInputsToMusicInputs(); + $('#voice-inputs-unused').empty(); $('#voice-inputs-selection').empty(); } @@ -307,7 +314,7 @@ // if this input is not in the available music inputs box and the current selection is not voice devices, add // it to the unused music inputs box if ($('#audio-inputs-unused > option[value="' + key + '"]').length === 0 && currentVoiceChat != VOICE_CHAT.CHAT) { - $('#audio-inputs-unused').append($(''); } }); } @@ -420,7 +427,7 @@ if (chatOption == VOICE_CHAT.SESSION) { $('#audio-inputs-unused').each(function(key, value) { if ($('#voice-inputs-unused > option[value="' + key + '"]').length === 0) { - $('#voice-inputs-unused').append($(''); } }); }