From 19c5541e0b1ec8e2ae188f7d826456bd29fbcbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 13 Sep 2018 09:51:46 +0200 Subject: [PATCH] maps: add tooltip to geolocate button (#26374) --- combo/apps/maps/static/js/combo.map.js | 4 +++- combo/apps/maps/static/js/leaflet-gps.js | 4 +++- combo/locale/fr/LC_MESSAGES/djangojs.po | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/combo/apps/maps/static/js/combo.map.js b/combo/apps/maps/static/js/combo.map.js index f2cec109..4ba8816e 100644 --- a/combo/apps/maps/static/js/combo.map.js +++ b/combo/apps/maps/static/js/combo.map.js @@ -144,7 +144,9 @@ $(function() { }).addTo(map); } if (L.Control.Gps && $map_widget.data('include-geoloc-button')) { - var gps_control = new L.Control.Gps({position: map_controls_position}); + var gps_control = new L.Control.Gps({ + position: map_controls_position, + tooltipTitle: gettext('Display my position')}); map.addControl(gps_control); } diff --git a/combo/apps/maps/static/js/leaflet-gps.js b/combo/apps/maps/static/js/leaflet-gps.js index 1757e838..1414239d 100644 --- a/combo/apps/maps/static/js/leaflet-gps.js +++ b/combo/apps/maps/static/js/leaflet-gps.js @@ -34,7 +34,8 @@ L.Control.Gps = L.Control.extend({ fillColor: '#f23', fillOpacity: 1 }, - position: 'topleft' + position: 'topleft', + tooltipTitle: 'Display my position' }, initialize: function(options) { @@ -54,6 +55,7 @@ L.Control.Gps = L.Control.extend({ this._button = L.DomUtil.create('a', 'gps-button', this._container); this._button.href = '#'; this._button.text = '\uf192'; + this._button.title = this.options.tooltipTitle; this._button.style.fontFamily = 'FontAwesome'; L.DomEvent .on(this._button, 'click', L.DomEvent.stop, this) diff --git a/combo/locale/fr/LC_MESSAGES/djangojs.po b/combo/locale/fr/LC_MESSAGES/djangojs.po index c950bdb7..cc61f697 100644 --- a/combo/locale/fr/LC_MESSAGES/djangojs.po +++ b/combo/locale/fr/LC_MESSAGES/djangojs.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: combo(js) 0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-09-13 07:22+0000\n" -"PO-Revision-Date: 2018-09-13 09:29+0200\n" +"POT-Creation-Date: 2018-09-13 07:51+0000\n" +"PO-Revision-Date: 2018-09-13 09:51+0200\n" "Last-Translator: Frederic Peters <\n" "Language: French\n" "MIME-Version: 1.0\n" @@ -23,3 +23,7 @@ msgstr "Zoomer" #: apps/maps/static/js/combo.map.js:143 msgid "Zoom out" msgstr "Dézoomer" + +#: apps/maps/static/js/combo.map.js:149 +msgid "Display my position" +msgstr "Afficher ma position" -- 2.19.0