diff --git a/static/js/pandora/editPanel.js b/static/js/pandora/editPanel.js index d7a149177..50aee4dff 100644 --- a/static/js/pandora/editPanel.js +++ b/static/js/pandora/editPanel.js @@ -138,6 +138,9 @@ pandora.ui.editPanel = function() { muted: function(data) { pandora.UI.set('videoMuted', data.muted); }, + open: function(data) { + pandora.UI.set(editPointsKey('clip'), data.ids[0]); + }, paste: function() { if (Ox.Clipboard.type() == 'clip') { pandora.api.addClips({ @@ -150,10 +153,16 @@ pandora.ui.editPanel = function() { } }, playing: function(data) { - pandora.UI.set(editPointsKey('position'), data.position); + var set = {}; + set[editPointsKey('clip')] = ''; + set[editPointsKey('position')] = data.position; + pandora.UI.set(set); }, position: function(data) { - pandora.UI.set(editPointsKey('position'), data.position); + var set = {}; + set[editPointsKey('clip')] = ''; + set[editPointsKey('position')] = data.position; + pandora.UI.set(set); }, remove: function(data) { if (edit.editable) { @@ -179,9 +188,6 @@ pandora.ui.editPanel = function() { scale: function(data) { pandora.UI.set('videoScale', data.scale); }, - select: function(data) { - pandora.UI.set(editPointsKey('clip'), data.ids[0]); - }, size: function(data) { pandora.UI.set('clipSize', data.size); }, diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index e0428fe12..50d3ca2b7 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -1168,12 +1168,21 @@ pandora.getSpan = function(state, val, callback) { }); } } else if (state.type == 'edits') { - pandora.api.getEdit({id: state.item, keys: ['duration']}, function(result) { - state.span = val.map(function(number) { - return Math.min(number, result.data.duration); + if (isArray) { + pandora.api.getEdit({id: state.item, keys: ['duration']}, function(result) { + state.span = val.map(function(number) { + return Math.min(number, result.data.duration); + }); + callback(); }); - callback(); - }); + } else { + pandora.api.getEdit({id: state.item, keys: ['clips']}, function(result) { + if (Ox.getObjectById(result.data.clips, val)) { + state.span = val; + } + callback(); + }); + } } else if (state.type == 'texts') { state.span = val; callback();