forked from 0x2620/pandora
update clip positions after sorting
This commit is contained in:
parent
53a3d37d74
commit
ac9ed0f5a8
1 changed files with 9 additions and 3 deletions
|
@ -447,6 +447,7 @@ pandora.ui.editPanel = function() {
|
|||
if (sort[0].operator == '-') {
|
||||
edit.clips.reverse();
|
||||
}
|
||||
updateDuration();
|
||||
callback(edit.clips);
|
||||
} else {
|
||||
pandora.api.sortClips({
|
||||
|
@ -457,19 +458,24 @@ pandora.ui.editPanel = function() {
|
|||
clip['sort'] = result.data.clips.indexOf(clip.id);
|
||||
});
|
||||
edit.clips = Ox.sortBy(edit.clips, 'sort');
|
||||
updateDuration();
|
||||
callback(edit.clips);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updateClips(clips) {
|
||||
clips = clips || edit.clips;
|
||||
edit.clips = clips;
|
||||
function updateDuration() {
|
||||
edit.duration = 0;
|
||||
edit.clips.forEach(function(clip) {
|
||||
clip.position = edit.duration;
|
||||
edit.duration += clip.duration;
|
||||
});
|
||||
}
|
||||
|
||||
function updateClips(clips) {
|
||||
clips = clips || edit.clips;
|
||||
edit.clips = clips;
|
||||
updateDuration();
|
||||
that.options({
|
||||
clips: Ox.clone(edit.clips),
|
||||
duration: edit.duration,
|
||||
|
|
Loading…
Reference in a new issue