[openstreetmap/openstreetmap-website] Stop setValue() always changing input text to coords (#1754)

Jamie Guthrie notifications at github.com
Wed Feb 14 18:43:47 UTC 2018


Stops the input text always getting set to coords.

Was unsure to use `endpoints[0].value` or `$("#route_from").val()`. Went with the jQuery because the first time you hit Go, `endpoint.value` is still the non-geocoded text (despite the input box text being geocoded)

Also not sure of positioning of `input.val(value)` in the `setValue()` method, and whether it needs to be copied into the else statement too (or whether it needs some different refactoring), but the general idea works.

Geocoded values are now saved in the url and stay as geocoded string values when reversing directions and pressing Go etc.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * setValue now sets the input text to the passed in argument

-- File Changes --

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

-- Patch Links --

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

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1754
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180214/ba591ca4/attachment.html>


More information about the rails-dev mailing list