katspaugh/wavesurfer.js — pull request #126 by mwise (2014-02-21 02:27:40+00:00)
Title: added enableDragSelect option and made loopSelection true by default

This PR adds an 'enableDragSelect' configuration option (true by default) that controls whether the click/drag-to-select functionality is enabled. I also made loopSelection true by default. This just seemed like the most useful configuration for most cases. Once you get used to the click-drag to highlight and loop a selection, it is hard to go back! I am open to @katspaugh's recommendation on what the default values for these options should be.

This isn't the most elegant solution to adding this feature. You'll see that I basically just return early in the various event handlers if enableDragSelect is not present. I think it would be marginally more performant to not even register those handlers if enableDragSelect is not true, but I am heading out of town for a week soon and wanted to at least get this option available. As it is, it seems to work fine.

Cheers,

Mark