From: Dan Stowell Date: Sun, 9 Aug 2015 11:11:07 +0000 (+0100) Subject: Allow users to get default contextmenu on shift-click X-Git-Tag: live~3617^2~4^2~5 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/8d0472f2cade9739f3b60cda17afe8289322e2f4?ds=sidebyside Allow users to get default contextmenu on shift-click --- 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);