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

Tom Hughes notifications at github.com
Sat Sep 27 13:28:48 UTC 2025


@tomhughes commented on this pull request.



> @@ -1,80 +1,200 @@
+/* global Popper */

Other global declarations are in `config/eslint.config.mjs` rather than being done on a per-file basis like this?

>  
-  const updateMenu = function updateMenu() {
-    map.contextmenu.setDisabled(2, map.getZoom() < 12);
-    map.contextmenu.setDisabled(4, map.getZoom() < 14);
-  };
+  OSM.renderContextMenu($contextMenu, contextmenuItems);
+};
+
+OSM.createSeparator = function () {

This (and `createMenuItem` and `renderContextMenu`) are only used from `initializeContextMenu` at the moment so they could just be declared in there rather than being exported in the `OSM` namespace unless you're expecting to be using them somewhere else?

Though I guess they may go away if you switch to rendering the menu on the server.

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

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


More information about the rails-dev mailing list