From 8d0472f2cade9739f3b60cda17afe8289322e2f4 Mon Sep 17 00:00:00 2001 From: Dan Stowell Date: Sun, 9 Aug 2015 12:11:07 +0100 Subject: [PATCH] Allow users to get default contextmenu on shift-click --- app/assets/javascripts/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index dbc4b8c33..69e223b22 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -98,6 +98,7 @@ $(document).ready(function () { })); } + // TODO only allow this if zoomed in enough var context_addnote = function(e){ // TODO this currently doesn't work correctly - I think the "route" needs to be chained to ensure it comes once the pan has finished. map.panTo(e.latlng, {animate: false}); @@ -144,6 +145,14 @@ $(document).ready(function () { }] }); + $(document).on('mousedown', function(e){ + if(e.shiftKey){ + map.contextmenu.disable(); // on firefox, shift disables our contextmenu. we explicitly do this for all browsers. + }else{ + map.contextmenu.enable(); + } + }); + map.attributionControl.setPrefix(''); map.updateLayers(params.layers); -- 2.43.2