handle clip ids in edit section

This commit is contained in:
rolux 2013-07-14 15:10:19 +00:00
parent e2cb8f7ead
commit d41d290ba5
2 changed files with 25 additions and 10 deletions

View file

@ -138,6 +138,9 @@ pandora.ui.editPanel = function() {
muted: function(data) { muted: function(data) {
pandora.UI.set('videoMuted', data.muted); pandora.UI.set('videoMuted', data.muted);
}, },
open: function(data) {
pandora.UI.set(editPointsKey('clip'), data.ids[0]);
},
paste: function() { paste: function() {
if (Ox.Clipboard.type() == 'clip') { if (Ox.Clipboard.type() == 'clip') {
pandora.api.addClips({ pandora.api.addClips({
@ -150,10 +153,16 @@ pandora.ui.editPanel = function() {
} }
}, },
playing: function(data) { 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) { 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) { remove: function(data) {
if (edit.editable) { if (edit.editable) {
@ -179,9 +188,6 @@ pandora.ui.editPanel = function() {
scale: function(data) { scale: function(data) {
pandora.UI.set('videoScale', data.scale); pandora.UI.set('videoScale', data.scale);
}, },
select: function(data) {
pandora.UI.set(editPointsKey('clip'), data.ids[0]);
},
size: function(data) { size: function(data) {
pandora.UI.set('clipSize', data.size); pandora.UI.set('clipSize', data.size);
}, },

View file

@ -1168,12 +1168,21 @@ pandora.getSpan = function(state, val, callback) {
}); });
} }
} else if (state.type == 'edits') { } else if (state.type == 'edits') {
pandora.api.getEdit({id: state.item, keys: ['duration']}, function(result) { if (isArray) {
state.span = val.map(function(number) { pandora.api.getEdit({id: state.item, keys: ['duration']}, function(result) {
return Math.min(number, result.data.duration); 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') { } else if (state.type == 'texts') {
state.span = val; state.span = val;
callback(); callback();