From 658b64288763c7ec294a75c5716436a0509d56b5 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 7 Feb 2014 08:41:47 +0000 Subject: [PATCH] fix bugs in video edit panel, clone some options --- source/Ox.UI/js/Video/ClipPanel.js | 4 ++-- source/Ox.UI/js/Video/VideoEditPanel.js | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/Ox.UI/js/Video/ClipPanel.js b/source/Ox.UI/js/Video/ClipPanel.js index 119ae77a..7071ac4b 100644 --- a/source/Ox.UI/js/Video/ClipPanel.js +++ b/source/Ox.UI/js/Video/ClipPanel.js @@ -35,7 +35,7 @@ Ox.ClipPanel = function(options, self) { .update({ clips: function() { self.$list.options({ - items: self.options.clips, + items: Ox.clone(self.options.clips), sort: getListSort(), sortable: isSortable() }); @@ -349,7 +349,7 @@ Ox.ClipPanel = function(options, self) { columnsRemovable: true, columnsResizable: true, columnsVisible: true, - items: self.options.clips, + items: Ox.clone(self.options.clips), keys: ['director'], scrollbarVisible: true, selected: self.options.selected, diff --git a/source/Ox.UI/js/Video/VideoEditPanel.js b/source/Ox.UI/js/Video/VideoEditPanel.js index cd4fbe6d..ac44ea2e 100644 --- a/source/Ox.UI/js/Video/VideoEditPanel.js +++ b/source/Ox.UI/js/Video/VideoEditPanel.js @@ -57,7 +57,7 @@ Ox.VideoEditPanel = function(options, self) { clips: function() { self.$clipPanel.options({ clips: Ox.clone(self.options.clips), - sort: self.options.sort + sort: Ox.clone(self.options.sort) }); }, duration: function() { @@ -134,6 +134,7 @@ Ox.VideoEditPanel = function(options, self) { movePositionTo('cut', -1); }, key_control_c: function() { + // FIXME: this looks wrong, should copy getSelectedClips that.triggerEvent('copy', [{ annotation: self.options.selected, 'in': self.options['in'], @@ -322,7 +323,7 @@ Ox.VideoEditPanel = function(options, self) { showAnnotationsMap: self.options.showAnnotationsMap, showLayers: self.options.showLayers, showUsers: self.options.showUsers, - sort: self.options.sort, + sort: Ox.clone(self.options.sort), sortOptions: self.options.sortOptions, view: self.options.clipView, width: self.options.clipSize @@ -362,7 +363,7 @@ Ox.VideoEditPanel = function(options, self) { resize: resizeClips, resizeend: resizeendClips, select: function(data) { - self.options.selected = data; + self.options.selected = data.ids; that.triggerEvent('select', data); }, sort: function(data) { @@ -626,7 +627,7 @@ Ox.VideoEditPanel = function(options, self) { }); } - that.getClipSelection = function() { + that.getSelectedClips = function() { return self.options.selected.length ? self.options.selected.map(function(id) { var clip = getClipById(id); return clip.annotation || clip.item + '/' + clip['in'] + '-' + clip.out;