From 71c163f9fbad05ce496b37a46a2186f238f799f3 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 27 Nov 2016 19:41:10 +0100 Subject: [PATCH] fix updating clipView --- source/UI/js/Video/ClipPanel.js | 34 +++++++++++++++++----------- source/UI/js/Video/VideoEditPanel.js | 5 ++++ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/source/UI/js/Video/ClipPanel.js b/source/UI/js/Video/ClipPanel.js index 01a630d3..32583026 100644 --- a/source/UI/js/Video/ClipPanel.js +++ b/source/UI/js/Video/ClipPanel.js @@ -71,6 +71,10 @@ Ox.ClipPanel = function(options, self) { sort: getListSort(), sortable: isSortable(), }); + }, + view: function() { + updateView(); + self.$menu.checkItem(self.options.view); } }) .bindEvent({ @@ -219,20 +223,8 @@ Ox.ClipPanel = function(options, self) { .bindEvent({ change: function(data) { if (data.id == 'view') { - var action = self.options.editable - && self.options.selected.length - && data.checked[0].id != 'annotations' - ? 'enableItem' : 'disableItem'; self.options.view = data.checked[0].id; - self.$menu[action]('split'); - self.$menu[ - self.options.editable - && self.options.selected.length > 1 - && data.checked[0].id != 'annotations' - ? 'enableItem' : 'disableItem' - ]('join'); - self.$menu[action]('replace'); - self.$panel.replaceElement(1, self.$list = getList()); + updateView(); that.triggerEvent('view', {view: self.options.view}); } }, @@ -657,6 +649,22 @@ Ox.ClipPanel = function(options, self) { ); } + function updateView() { + var action = self.options.editable + && self.options.selected.length + && self.options.view != 'annotations' + ? 'enableItem' : 'disableItem'; + self.$menu[action]('split'); + self.$menu[ + self.options.editable + && self.options.selected.length > 1 + && self.options.view != 'annotations' + ? 'enableItem' : 'disableItem' + ]('join'); + self.$menu[action]('replace'); + self.$panel.replaceElement(1, self.$list = getList()); + } + that.getPasteIndex = function() { return self.$list.getPasteIndex(); }; diff --git a/source/UI/js/Video/VideoEditPanel.js b/source/UI/js/Video/VideoEditPanel.js index 72b02270..fb1e64f7 100644 --- a/source/UI/js/Video/VideoEditPanel.js +++ b/source/UI/js/Video/VideoEditPanel.js @@ -69,6 +69,11 @@ Ox.VideoEditPanel = function(options, self) { self.$mainPanel.resizeElement(1, self.options.clipSize); resizeClips({size: self.options.clipSize}); }, + clipView: function() { + self.$clipPanel.options({ + view: self.options.clipView + }); + }, duration: function() { self.$timeline && self.$timeline.replaceWith( self.$timeline = getTimeline()