Projet

Général

Profil

0001-maps-use-Leaflet.GestureHandling-to-avoid-zooming-on.patch

Frédéric Péters, 25 janvier 2020 20:38

Télécharger (3,16 ko)

Voir les différences:

Subject: [PATCH] maps: use Leaflet.GestureHandling to avoid zooming on map
 during scroll (#39058)

 debian/control                     | 1 +
 setup.py                           | 1 +
 wcs/qommon/http_response.py        | 2 ++
 wcs/qommon/static/js/qommon.map.js | 2 ++
 wcs/root.py                        | 2 +-
 5 files changed, 7 insertions(+), 1 deletion(-)
debian/control
23 23
    python3-requests,
24 24
    python3-vobject,
25 25
    python3-xstatic-leaflet,
26
    python3-xstatic-leaflet-gesturehandling,
26 27
    uwsgi,
27 28
    uwsgi-plugin-python3
28 29
Recommends: python3-dns,
setup.py
123 123
            'django-ckeditor<=4.5.3',
124 124
            'django-ratelimit<3',
125 125
            'XStatic-Leaflet',
126
            'XStatic-Leaflet-GestureHandling',
126 127
            'pyproj',
127 128
        ],
128 129
        package_dir = { 'wcs': 'wcs' },
wcs/qommon/http_response.py
72 72
                if script_name == 'qommon.map.js':
73 73
                    self.add_javascript(['jquery.js'])
74 74
                    self.add_javascript(['../xstatic/leaflet.js'])
75
                    self.add_javascript(['../xstatic/leaflet-gesture-handling.min.js'])
75 76
                    self.add_css_include('../xstatic/leaflet.css')
77
                    self.add_css_include('../xstatic/leaflet-gesture-handling.min.css')
76 78
                    self.add_javascript(['leaflet-gps.js'])
77 79
                    self.add_javascript(['../../i18n.js'])
78 80
                if script_name == 'qommon.wysiwyg.js':
wcs/qommon/static/js/qommon.map.js
28 28
       map_options.scrollWheelZoom = 'center';
29 29
       map_options.doubleClickZoom = 'center';
30 30
       map_options.maxBounds = null;
31
     } else {
32
       map_options.gestureHandling = true;
31 33
     }
32 34
     var map = L.map($(this).attr('id'), map_options);
33 35
     var map_controls_position = $('body').data('map-controls-position') || 'topleft';
wcs/root.py
195 195
        '': ['web', 'qommon', 'django:gadjo', 'django:ckeditor'],
196 196
        'xstatic': ['xstatic:jquery', 'xstatic:jquery_ui',
197 197
                    'xstatic:font_awesome', 'xstatic:opensans',
198
                    'xstatic:leaflet',],
198
                    'xstatic:leaflet', 'xstatic:leaflet_gesturehandling'],
199 199
    }
200 200

  
201 201
    @classmethod
202
-