dasmoth / dalliance

Interactive web-based genome browser.
http://www.biodalliance.org/
BSD 2-Clause "Simplified" License
226 stars 68 forks source link

listener callback for zooming #99

Closed Traksewt closed 9 years ago

Traksewt commented 9 years ago

I need to determine when the user has changed the viewport. the ViewListener works well for panning, however it does not receive zooming events from the zoom slider.

I can make the zoom function in cbrowser fire a notifyLocation event so that the ViewListener will get the zoom events when the viewport changes. Another alternative would be to make zoom events go to a separate zoom listener (though is unnecessary/overkill for my purposes).

dasmoth commented 9 years ago

Thanks for submitting a pull request.

The initial thinking about this was that the zoom slider could potentially generate events too frequently for listeners to keep up. However, things have moved on, and I now tend to think that listeners worries about getting too many events should be debouncing them themselves. So I think this is fine.

If it does cause anyone any trouble, we could add an extra flag on events triggered by the zoom slider.