From 026574c43f99b19de86db86450f3712794c8f724 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 10 Aug 2013 11:22:38 +0000 Subject: [PATCH] fix a bug in join clips --- source/Ox.UI/js/Video/ClipPanel.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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}; });