hide volume column for smart edits

This commit is contained in:
j 2021-08-04 14:10:01 +02:00
parent 03c2f9f3a1
commit 1e0537c95f

View file

@ -89,7 +89,7 @@ Ox.ClipPanel = function(options, self) {
} }
}); });
self.columns = [ self.columns = [].concat([
{ {
align: 'right', align: 'right',
id: 'index', id: 'index',
@ -183,7 +183,9 @@ Ox.ClipPanel = function(options, self) {
visible: true, visible: true,
width: 90 width: 90
}, },
{ ],
hasVolume() ?
[{
align: 'right', align: 'right',
editable: self.options.editable, editable: self.options.editable,
format: function(value, data) { format: function(value, data) {
@ -198,6 +200,8 @@ Ox.ClipPanel = function(options, self) {
visible: false, visible: false,
width: 45 width: 45
}, },
] : [],
[
{ {
addable: false, addable: false,
id: 'sort', id: 'sort',
@ -205,7 +209,8 @@ Ox.ClipPanel = function(options, self) {
// title: Ox._('Sort'), // title: Ox._('Sort'),
visible: false visible: false
} }
]; ]
);
self.$menubar = Ox.Bar({ self.$menubar = Ox.Bar({
size: 24 size: 24
@ -587,6 +592,12 @@ Ox.ClipPanel = function(options, self) {
&& self.options.sort[0].operator == '+'; && self.options.sort[0].operator == '+';
} }
function hasVolume() {
return self.options.editable
&& self.options.sort && self.options.sort.length
&& self.options.sort[0].key == 'index'
}
function joinClips() { function joinClips() {
var clips = getEditable(self.options.selected).map(function(id) { var clips = getEditable(self.options.selected).map(function(id) {
return Ox.clone(Ox.getObjectById(self.options.clips, id)); return Ox.clone(Ox.getObjectById(self.options.clips, id));