use the right index while adding clips to an edit

This commit is contained in:
j 2014-02-03 12:50:17 +00:00
commit 1702b37877
2 changed files with 17 additions and 2 deletions

View file

@ -232,7 +232,12 @@ pandora.ui.editPanel = function() {
var clips = pandora.clipboard.paste();
pandora.doHistory('paste', clips, ui.edit, function(result) {
Ox.Request.clearCache('getEdit');
updateClips(edit.clips.concat(result.data.clips));
updateClips(edit.clips.map(function(clip) {
if (clip.index >= result.data.clips[0].index) {
clip.index += result.data.clips.length
}
return clip;
}).concat(result.data.clips));
});
},
playing: function(data) {