From f302db94906e4b56a301297682deaf5f24bacc74 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 23 Mar 2015 17:26:41 +0530 Subject: [PATCH] pass showLayers from panels to folder --- source/UI/js/Video/AnnotationPanel.js | 6 ++++++ source/UI/js/Video/ClipPanel.js | 7 +++++++ source/UI/js/Video/VideoAnnotationPanel.js | 5 +++++ source/UI/js/Video/VideoEditPanel.js | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/source/UI/js/Video/AnnotationPanel.js b/source/UI/js/Video/AnnotationPanel.js index 0c6f1794..5e65bb57 100644 --- a/source/UI/js/Video/AnnotationPanel.js +++ b/source/UI/js/Video/AnnotationPanel.js @@ -83,6 +83,12 @@ Ox.AnnotationPanel = function(options, self) { $folder.options({selected: ''}); }); } + } else if (key == 'showLayers') { + self.options.layers.forEach(function(layer, index) { + self.$folder[index].options({ + collapsed: !self.options.showLayers[layer.id] + }); + }); } else if (key == 'width') { self.$folder.forEach(function($folder) { $folder.options({width: self.options.width - Ox.UI.SCROLLBAR_SIZE}); diff --git a/source/UI/js/Video/ClipPanel.js b/source/UI/js/Video/ClipPanel.js index acfac9f3..c06870d5 100644 --- a/source/UI/js/Video/ClipPanel.js +++ b/source/UI/js/Video/ClipPanel.js @@ -58,6 +58,13 @@ Ox.ClipPanel = function(options, self) { } }, selected: selectClips, + showLayers: function() { + if (self.options.view == 'annotations') { + self.$list.options({ + showLayers: Ox.clone(self.options.showLayers) + }); + } + }, sort: function() { updateSortElement(); self.$list.options({ diff --git a/source/UI/js/Video/VideoAnnotationPanel.js b/source/UI/js/Video/VideoAnnotationPanel.js index c92e196d..30c76902 100644 --- a/source/UI/js/Video/VideoAnnotationPanel.js +++ b/source/UI/js/Video/VideoAnnotationPanel.js @@ -131,6 +131,11 @@ Ox.VideoAnnotationPanel = function(options, self) { showAnnotations: function() { self.$mainPanel.toggleElement(1); }, + showLayers: function() { + self.$annotationPanel.options({ + showLayers: Ox.clone(self.options.showLayers) + }); + }, timeline: function() { self.$menuButton.checkItem('timelines_' + self.options.timeline); updateTimelines(); diff --git a/source/UI/js/Video/VideoEditPanel.js b/source/UI/js/Video/VideoEditPanel.js index b61e8868..0a30ae06 100644 --- a/source/UI/js/Video/VideoEditPanel.js +++ b/source/UI/js/Video/VideoEditPanel.js @@ -95,6 +95,11 @@ Ox.VideoEditPanel = function(options, self) { showClips: function() { self.$mainPanel.toggle(1); }, + showLayers: function() { + self.$clipPanel.options({ + showLayers: self.options.showLayers + }); + }, showTimeline: function() { self.$videoPanel.toggle(2); },