forked from 0x2620/oxjs
add 'editable' timeline state (fixes #521)
This commit is contained in:
parent
b12099a9d7
commit
2c2caf8f58
2 changed files with 10 additions and 3 deletions
|
|
@ -93,7 +93,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
if (self.editing) {
|
||||
// submitAnnotation();
|
||||
blurAnnotation();
|
||||
} else if (self.options.selected) {
|
||||
} else if (isEditable()) {
|
||||
editAnnotation();
|
||||
}
|
||||
},
|
||||
|
|
@ -966,6 +966,11 @@ Ox.VideoEditor = function(options, self) {
|
|||
setPosition(self.options[point]);
|
||||
}
|
||||
|
||||
function isEditable() {
|
||||
var annotation = Ox.getObjectById(self.annotations, self.options.selected);
|
||||
return annotation && annotation.editable;
|
||||
}
|
||||
|
||||
function movePositionBy(sec) {
|
||||
setPosition(Ox.limit(self.options.position + sec, 0, self.options.duration));
|
||||
}
|
||||
|
|
@ -1149,6 +1154,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
function setTimelineState() {
|
||||
self.$timeline[1].options({
|
||||
state: self.editing ? 'editing'
|
||||
: isEditable() ? 'editable'
|
||||
: self.options.selected ? 'selected'
|
||||
: 'default'
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue