[openstreetmap/openstreetmap-website] Bootstrap contextmenu (PR #6410)

mmd notifications at github.com
Mon Sep 22 16:18:37 UTC 2025


This PR replaces the current Leaflet.contextmenu based context menu by a Bootstrap based version. Adds a new dependency on [Bootstrap icons](https://icons.getbootstrap.com/)

<img width="640" height="462" alt="image" src="https://github.com/user-attachments/assets/351e3784-996a-4e3b-a368-b0d0b1401bf2" />



Fixes #6383

### How has this been tested?
* Local tests on desktop / mobile browsers, checking if all 6 actions are still working
* Test all four corners of the screen, dropdown is supposed to stay within map boundaries
* LTR and RTL mode
* Normal/Dark mode, including currently highlighted menu item
* Depending on zoom level, "Query features" and "Add a note here" are disabled
* Dropdown is hidden when: (1) clicking on an action, (2) clicking anywhere in the window, (3) panning the map.

You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Remove leaflet.contextmenu plugin and old contextmenu
  * Added Bootstrap based contextmenu

-- File Changes --

    M Vendorfile (5)
    M app/assets/javascripts/index.js (1)
    M app/assets/javascripts/index/contextmenu.js (174)
    M app/assets/stylesheets/common.scss (37)
    M app/assets/stylesheets/leaflet-all.scss (1)
    A app/views/layouts/_contextmenu.html.erb (42)
    M app/views/layouts/map.html.erb (2)
    M config/initializers/content_security_policy.rb (2)
    M config/locales/en.yml (16)
    M package.json (1)
    D vendor/assets/leaflet/leaflet.contextmenu.css (54)
    D vendor/assets/leaflet/leaflet.contextmenu.js (592)
    M yarn.lock (5)

-- Patch Links --

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

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

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


More information about the rails-dev mailing list