forked from 0x2620/pandora
handle clip ids in edit section
This commit is contained in:
parent
e2cb8f7ead
commit
d41d290ba5
2 changed files with 25 additions and 10 deletions
|
@ -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);
|
||||
},
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue