CC-5108 : Waveform Editor UI

making sure the correct li is activated when a track has a decoding error.
This commit is contained in:
Naomi Aro 2013-05-24 11:23:08 -04:00
parent 46cc2d00b8
commit f5e03db9fe

View file

@ -209,12 +209,11 @@ var AIRTIME = (function(AIRTIME){
} }
/* used from waveform pop-up */ /* used from waveform pop-up */
function changeCrossfade($el, id1, id2, fadeIn, fadeOut, offset) { function changeCrossfade($el, id1, id2, fadeIn, fadeOut, offset, id) {
var url = baseUrl+"Playlist/set-crossfade", var url = baseUrl+"Playlist/set-crossfade",
lastMod = getModified(), lastMod = getModified(),
type = $('#obj_type').val(), type = $('#obj_type').val();
li, id;
$.post(url, $.post(url,
{format: "json", fadeIn: fadeIn, fadeOut: fadeOut, id1: id1, id2: id2, offset: offset, modified: lastMod, type: type}, {format: "json", fadeIn: fadeIn, fadeOut: fadeOut, id1: id1, id2: id2, offset: offset, modified: lastMod, type: type},
@ -230,10 +229,9 @@ var AIRTIME = (function(AIRTIME){
setPlaylistContent(json); setPlaylistContent(json);
id = id1 === undefined ? id2 : id1; $li = $('#side_playlist li[unqid='+id+']');
li = $('#side_playlist li[unqid='+id+']'); $li.find('.crossfade').toggle();
li.find('.crossfade').toggle(); highlightActive($li.find('.spl_fade_control'));
highlightActive(li.find('.spl_fade_control'));
}); });
} }
@ -1179,13 +1177,16 @@ var AIRTIME = (function(AIRTIME){
mod.showFadesWaveform = function(e) { mod.showFadesWaveform = function(e) {
var $el = $(e.target), var $el = $(e.target),
$parent = $el.parents("dl"), $parent = $el.parents("dl"),
$li = $el.parents("li"),
$fadeOut = $parent.find(".spl_fade_out"), $fadeOut = $parent.find(".spl_fade_out"),
$fadeIn = $parent.find(".spl_fade_in"), $fadeIn = $parent.find(".spl_fade_in"),
$html = $($("#tmpl-pl-fades").html()), $html = $($("#tmpl-pl-fades").html()),
tracks = [], tracks = [],
dim = AIRTIME.utilities.findViewportDimensions(), dim = AIRTIME.utilities.findViewportDimensions(),
playlistEditor, playlistEditor,
id1, id2; id1, id2,
id = $li.attr("unqid");
function removeDialog() { function removeDialog() {
playlistEditor.stop(); playlistEditor.stop();
@ -1284,7 +1285,7 @@ var AIRTIME = (function(AIRTIME){
fadeIn = (fadeIn === undefined) ? undefined : fadeIn.toFixed(1); fadeIn = (fadeIn === undefined) ? undefined : fadeIn.toFixed(1);
fadeOut = (fadeOut === undefined) ? undefined : fadeOut.toFixed(1); fadeOut = (fadeOut === undefined) ? undefined : fadeOut.toFixed(1);
changeCrossfade($html, id1, id2, fadeIn, fadeOut, offset); changeCrossfade($html, id1, id2, fadeIn, fadeOut, offset, id);
}} }}
], ],
open: function (event, ui) { open: function (event, ui) {