[openstreetmap/openstreetmap-website] Rename geocodeCallback to changeCallback, call it from latlon setValue (PR #5081)

Anton Khorev notifications at github.com
Thu Aug 15 09:15:59 UTC 2024


Another piece of #5064 which changes how callbacks work. The code outside endpoints module shouldn't care if geocoding was performed or not. Previously there was a special callback for completed geocoding, you waited for it and then you built the route. But if you passed coordinates to endpoint.setValue you knew that geocoding may not happen therefore you had to try to build the route right away. Now you just always wait for a callback because it happens even without geocoding.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Rename geocodeCallback to changeCallback, call it from latlon setValue

-- File Changes --

    M app/assets/javascripts/index/directions-endpoint.js (5)
    M app/assets/javascripts/index/directions.js (9)

-- Patch Links --

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

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

Message ID: <openstreetmap/openstreetmap-website/pull/5081 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240815/0b1f91f0/attachment.htm>


More information about the rails-dev mailing list