added enableDragSelect option and made loopSelection true by default #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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