[openstreetmap/openstreetmap-website] Use callbacks instead of direct getRoute() calls from route endpoints (PR #4902)

Anton Khorev notifications at github.com
Sat Jun 15 19:26:09 UTC 2024


Directions page javascript controller has two route endpoint objects. They manage from/to inputs and markers. When inputs and markers are updated, endpoint objects call `getRoute` method of the controller to redraw the route. But why should endpoints know anything about the entire route? They only need to report that an input or a marker was updated and let the outside code decide what to do in response.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4902

-- Commit Summary --

  * Introduce drag event callback for route endpoints
  * Introduce geocode event callback for route endpoints

-- File Changes --

    M app/assets/javascripts/index/directions.js (21)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4902.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4902.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4902
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4902 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240615/4eb8d520/attachment.htm>


More information about the rails-dev mailing list