fix links for clips without clipLayer annotations

This commit is contained in:
j 2014-11-21 16:40:27 +00:00
parent 83c01841c4
commit 1483c13a3c

View file

@ -138,7 +138,8 @@ pandora.ui.clipList = function(videoRatio) {
copy: function(data) { copy: function(data) {
var items = data.ids.map(function(id) { var items = data.ids.map(function(id) {
var item = !ui.item ? id.split('/')[0] : ui.item, var item = !ui.item ? id.split('/')[0] : ui.item,
annotation = that.value(id, 'annotations')[0].id; annotations = that.value(id, 'annotations') || [],
annotation = annotations.length ? annotations[0].id : null;
return annotation || item + '/' + that.value(id, 'in') + '-' + that.value(id, 'out'); return annotation || item + '/' + that.value(id, 'in') + '-' + that.value(id, 'out');
}) })
pandora.clipboard.copy(items, 'clip'); pandora.clipboard.copy(items, 'clip');
@ -146,7 +147,8 @@ pandora.ui.clipList = function(videoRatio) {
copyadd: function(data) { copyadd: function(data) {
var items = data.ids.map(function(id) { var items = data.ids.map(function(id) {
var item = !ui.item ? id.split('/')[0] : ui.item, var item = !ui.item ? id.split('/')[0] : ui.item,
annotation = that.value(id, 'annotations')[0].id; annotations = that.value(id, 'annotations') || [],
annotation = annotations.length ? annotations[0].id : null;
return annotation || item + '/' + that.value(id, 'in') + '-' + that.value(id, 'out'); return annotation || item + '/' + that.value(id, 'in') + '-' + that.value(id, 'out');
}) })
pandora.clipboard.add(items, 'clip'); pandora.clipboard.add(items, 'clip');
@ -162,7 +164,8 @@ pandora.ui.clipList = function(videoRatio) {
open: function(data) { open: function(data) {
var id = data.ids[0], var id = data.ids[0],
item = !ui.item ? id.split('/')[0] : ui.item, item = !ui.item ? id.split('/')[0] : ui.item,
annotation = that.value(id, 'annotations')[0].id, annotations = that.value(id, 'annotations') || [],
annotation = annotations.length ? annotations[0].id : null;
points = { points = {
annotation: annotation ? annotation.split('/')[1] : '', annotation: annotation ? annotation.split('/')[1] : '',
'in': that.value(id, 'in'), 'in': that.value(id, 'in'),