diff --git a/source/Ox.UI/js/Video/ClipPanel.js b/source/Ox.UI/js/Video/ClipPanel.js index 7e348f0f..6e9a8705 100644 --- a/source/Ox.UI/js/Video/ClipPanel.js +++ b/source/Ox.UI/js/Video/ClipPanel.js @@ -173,9 +173,9 @@ Ox.ClipPanel = function(options, self) { {id: 'annotations', title: Ox._('View Annotations'), checked: self.options.view == 'annotations'}, ]}, {}, - {id: 'split', title: Ox._('Split Selected Clips at Cuts'), disabled: !self.options.editable || !self.options.selected.length || self.options.view == 'annotations'}, - {id: 'join', title: Ox._('Join Selected Clips at Cuts'), disabled: !self.options.editable || !self.options.selected.length || self.options.view == 'annotations'}, - {id: 'replace', title: Ox._('Make Selected Clips Editable'), disabled: !self.options.editable || !self.options.selected.length || self.options.view == 'annotations'} + {id: 'split', title: Ox._('Split Selected Clips at Cuts'), disabled: !self.options.editable || !self.options.selected.length > 0 || self.options.view == 'annotations'}, + {id: 'join', title: Ox._('Join Selected Clips at Cuts'), disabled: !self.options.editable || !self.options.selected.length > 1 || self.options.view == 'annotations'}, + {id: 'replace', title: Ox._('Make Selected Clips Editable'), disabled: !self.options.editable || !self.options.selected.length > 0 || self.options.view == 'annotations'} ], title: 'set', tooltip: Ox._('Options'), @@ -430,6 +430,9 @@ Ox.ClipPanel = function(options, self) { that.triggerEvent('select', data); }, sort: function(data) { + if (['in', 'out'].indexOf(data.key) > -1) { + data.key = 'position'; + } self.options.sort = [data]; updateSortElement(); self.$list.options({sortable: isSortable()}); @@ -467,6 +470,9 @@ Ox.ClipPanel = function(options, self) { sort[0].key = Ox.getObjectById(self.columns, self.options.sort[0].key) ? self.options.sort[0].key : 'sort'; + if (self.options.sort[0].key == 'position') { + sort[0].key = 'in'; + } } return sort; } @@ -524,11 +530,13 @@ Ox.ClipPanel = function(options, self) { } function selectClips() { - var action; if (self.options.editable) { - action = self.options.selected.length ? 'enableItem' : 'disableItem'; - self.$menu[action]('split'); - self.$menu[action]('join'); + self.$menu[ + self.options.selected.length > 0 ? 'enableItem' : 'disableItem' + ]('split'); + self.$menu[ + self.options.selected.length > 1 ? 'enableItem' : 'disableItem' + ]('join'); } self.$list.options({selected: self.options.selected}); }