From 86b090a29f334d748333d423b1ea17a3b94755d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Tue, 31 Oct 2017 18:00:26 +0100 Subject: [PATCH] move .leaflet-touch disable code elsewhere due to leaflet update --- src/c3nav/editor/static/editor/js/editor.js | 11 +++-------- src/c3nav/site/static/site/js/c3nav.js | 9 ++++----- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 9f5dacc0..2daa1c78 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -1,11 +1,3 @@ -(function () { - if(L.Browser.chrome && !('ontouchstart' in window)) { - L.Browser.pointer = false; - L.Browser.touch = false; - } -}()); - - editor = { options: { position: 'bottomright' @@ -22,6 +14,9 @@ editor = { editable: true, closePopupOnClick: false }); + if (L.Browser.chrome && !('ontouchstart' in window)) { + $('.leaflet-touch').removeClass('leaflet-touch'); + } editor.map.on('click', function () { editor.map.doubleClickZoom.enable(); }); diff --git a/src/c3nav/site/static/site/js/c3nav.js b/src/c3nav/site/static/site/js/c3nav.js index 53ce5b4a..f53cadbb 100644 --- a/src/c3nav/site/static/site/js/c3nav.js +++ b/src/c3nav/site/static/site/js/c3nav.js @@ -1,9 +1,4 @@ (function () { - if (L.Browser.chrome && !('ontouchstart' in window)) { - L.Browser.pointer = false; - L.Browser.touch = false; - } - /* * Workaround for 1px lines appearing in some browsers due to fractional transforms * and resulting anti-aliasing. @@ -426,6 +421,10 @@ c3nav = { zoomSnap: 0, zoomControl: false }); + if (L.Browser.chrome && !('ontouchstart' in window)) { + $('.leaflet-touch').removeClass('leaflet-touch'); + } + c3nav.map.fitBounds(L.GeoJSON.coordsToLatLngs(c3nav.bounds), c3nav._add_map_padding({})); c3nav.map.on('moveend', c3nav._map_moved);