diff --git a/source/UI/js/Video/VideoAnnotationPanel.js b/source/UI/js/Video/VideoAnnotationPanel.js index a3935b1e..639fa1fa 100644 --- a/source/UI/js/Video/VideoAnnotationPanel.js +++ b/source/UI/js/Video/VideoAnnotationPanel.js @@ -938,7 +938,7 @@ Ox.VideoAnnotationPanel = function(options, self) { that.triggerEvent('resizemap', data); }, select: function(data) { - selectAnnotation(data, true); + selectAnnotation(data, !self.updating); }, showentityinfo: function(data) { that.triggerEvent('showentityinfo', data); @@ -1340,7 +1340,7 @@ Ox.VideoAnnotationPanel = function(options, self) { that.triggerEvent('annotationssize', {size: data.size}); } - function selectAnnotation(data, stayAtPosition) { + function selectAnnotation(data, moveToPosition) { if (Ox.isUndefined(data)) { // doubleclick on small timeline data = getAnnotation(); @@ -1351,13 +1351,11 @@ Ox.VideoAnnotationPanel = function(options, self) { // FIXME // self.editing = false; if (data.id) { - if (!stayAtPosition || ( - self.options.annotationsRange != 'position' && ( - self.options.position < data['in'] - || self.options.position > data.out - ) - ) - ) { + var outOfRange = self.options.annotationsRange != 'position' && ( + self.options.position < data['in'] + || self.options.position > data.out + ) + if (moveToPosition && outOfRange) { setPosition(data['in']); // if annotationsRange is 'position', // this may cause a deselect @@ -1717,6 +1715,7 @@ Ox.VideoAnnotationPanel = function(options, self) { (id, annotation) -> update annotation with id @*/ that.updateAnnotation = function(id, annotation) { + self.updating = true // called from editannotation callback // id might have changed if new annotation was created if (annotation.id) { @@ -1730,6 +1729,7 @@ Ox.VideoAnnotationPanel = function(options, self) { self.annotations = getAnnotations(); setTimelineState(); } + self.updating = false }; /*@