[openstreetmap/openstreetmap-website] Show/hide query intro text depending on query mode (PR #3709)

Anton Khorev notifications at github.com
Thu Sep 22 09:56:49 UTC 2022


When you use *Query features* map tool, a sidebar shows with this message "Click on the map to find nearby features." The message had a `query-intro` css class added in https://github.com/openstreetmap/openstreetmap-website/commit/078059b76b. Then the class was removed in https://github.com/openstreetmap/openstreetmap-website/commit/c8f0a81eb7043c297e050c1f3ff8a8cf7ff613bc. However there's still the js code that tries to hide this message based on its class. This happens as soon as the query runs.

But the query runs as soon as the sidebar is shown. If hiding is restored, the user won't have time to read the message, and then there's no point in writing it. On the other hand, if the message is not hidden, it will tell the user to click the map even when clicking will have no effect.

Here I'm showing/hiding the message depending on if it's possible to click the map and get a query to run.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Show/hide query intro text depending on query mode
  * Take into account query button disabled state when showing/hiding query intro text

-- File Changes --

    M app/assets/javascripts/index/query.js (40)
    M app/views/browse/query.html.erb (2)

-- Patch Links --

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

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

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


More information about the rails-dev mailing list