From 60cff7874080290418e38bb23563c5ca8416f1d9 Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Thu, 20 Nov 2014 11:31:32 +0100 Subject: [PATCH] disable creation of new audio annotations in readony mode --- static/coffee/audioplayer.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/coffee/audioplayer.coffee b/static/coffee/audioplayer.coffee index def3a0b..a8b9db0 100644 --- a/static/coffee/audioplayer.coffee +++ b/static/coffee/audioplayer.coffee @@ -70,11 +70,13 @@ class AudioPlayer newTime = totalTime * (ec.y / @height) @audio.currentTime = newTime else + if @readOnly + return # Annotation stuff ec = @eventCoords e time = @pixelsToSeconds ec.y annotation = @annotationAt time - if annotation? and !@readOnly + if annotation? # Move @audiodrag = new AudioDrag time, (timeDelta) => originalStart = annotation.start