fix updating clipView

This commit is contained in:
j 2016-11-27 19:41:10 +01:00
parent e288749077
commit 71c163f9fb
2 changed files with 26 additions and 13 deletions

View file

@ -71,6 +71,10 @@ Ox.ClipPanel = function(options, self) {
sort: getListSort(), sort: getListSort(),
sortable: isSortable(), sortable: isSortable(),
}); });
},
view: function() {
updateView();
self.$menu.checkItem(self.options.view);
} }
}) })
.bindEvent({ .bindEvent({
@ -219,20 +223,8 @@ Ox.ClipPanel = function(options, self) {
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
if (data.id == 'view') { 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.options.view = data.checked[0].id;
self.$menu[action]('split'); updateView();
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());
that.triggerEvent('view', {view: self.options.view}); 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() { that.getPasteIndex = function() {
return self.$list.getPasteIndex(); return self.$list.getPasteIndex();
}; };

View file

@ -69,6 +69,11 @@ Ox.VideoEditPanel = function(options, self) {
self.$mainPanel.resizeElement(1, self.options.clipSize); self.$mainPanel.resizeElement(1, self.options.clipSize);
resizeClips({size: self.options.clipSize}); resizeClips({size: self.options.clipSize});
}, },
clipView: function() {
self.$clipPanel.options({
view: self.options.clipView
});
},
duration: function() { duration: function() {
self.$timeline && self.$timeline.replaceWith( self.$timeline && self.$timeline.replaceWith(
self.$timeline = getTimeline() self.$timeline = getTimeline()