Hi,
I've a custom recipe that let the user rename a wavesurfer region by selecting the label and then do a double-click on the region.
To do so, I remove the region and create another one with the same timestamp and fire an "region-update-end" event. Thus, the region is removed without clicking on the 'x' (delete button) so I have to update the content of the current task with window.prodigy.update()
.
The issue is that every time the user interacts with the regions, (e.g. if he moves one with the mouse), the old regions are put back in prodigy.content.audio_spans
, I don't know how.
For example, if there is only one region and I do (we can select the region with wavesurfer.regions.list) :
myregion.remove()
And update prodigy.content with :
window.prodigy.update({audio_spans : []})
Everything is fine (nothing on screen and nothing on prodigy.content.audio_spans).
Then if the user create/move another one, the delete region is back in prodigy.content.audio_spans
(with the new one) as if the update had never been done, is that normal ?
Thanks you,
Jim