diff --git a/source/Ox.UI/js/Video/ClipPanel.js b/source/Ox.UI/js/Video/ClipPanel.js index c07c4785..5d935e56 100644 --- a/source/Ox.UI/js/Video/ClipPanel.js +++ b/source/Ox.UI/js/Video/ClipPanel.js @@ -407,9 +407,12 @@ Ox.ClipPanel = function(options, self) { Ox.forEach(clips, function(inClip, index) { var inPoint = inClip.item + '/' + inClip['in']; if (inPoint == outPoint) { - ids = ids.concat([outClip.id, inClip.id]); - join.push(outClip.id); + ids = Ox.unique(ids.concat([outClip.id, inClip.id])); + join = Ox.unique(join.concat([outClip.id])); outClip.out = inClip.out; + if (Ox.contains(join, inClip.id)) { + join.splice(join.indexOf(inClip.id), 1); + } clips.splice(index, 1); joined = true; return false; // break @@ -420,8 +423,7 @@ Ox.ClipPanel = function(options, self) { } }); } while (joined); - ids = Ox.unique(ids); - join = Ox.unique(join).map(function(id) { + join = join.map(function(id) { var clip = Ox.getObjectById(clips, id); return {'in': clip['in'], item: clip.item, out: clip.out}; });