From 1f060deb30d4372f174ddfbd06946c3a641011c6 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Fri, 2 Dec 2016 14:53:26 +0100 Subject: [PATCH] popup style, set tooltips on load --- css/gpxedit.css | 7 +++++-- js/gpxedit.js | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/css/gpxedit.css b/css/gpxedit.css index eae43c3..c1ab783 100644 --- a/css/gpxedit.css +++ b/css/gpxedit.css @@ -491,10 +491,13 @@ input[type=checkbox] font-weight: bold !important; } h2#loadtitle, h2#savetitle{ - text-align:center; + text-align: center; cursor: pointer; } -#clearButton{ +h2.popupTitle{ + text-align: center; +} +#clearButton, .popupOkButton{ margin-left: auto; margin-right: auto; display:block; diff --git a/js/gpxedit.js b/js/gpxedit.js index 1c6e873..a7ecc53 100644 --- a/js/gpxedit.js +++ b/js/gpxedit.js @@ -246,14 +246,15 @@ function load_map() { // it generates the popup content and initializes the layer's data // it returns the layer in case we want to set the layer's data manually (when loading a gpx) function onCreated(type, layer){ - var popupTitle = 'Line'; + var popupTitle = 'Track'; if (type === 'marker') { popupTitle = 'Waypoint'; } - layer.bindPopup('

'+popupTitle+'

Name :
'+ - 'Description :
'+ - 'Comment :
'+ + layer.bindPopup('

'+popupTitle+'

'+ + ''+ + ''+ + '
Name
Description
Comment
'+ ''); layer.gpxedit_id = gpxedit.id; @@ -352,6 +353,7 @@ function drawMarker(latlng, name, desc, cmt){ }) }); var layer = onCreated('marker', m); + m.bindTooltip(name, {sticky:true}); gpxedit.layersData[layer.gpxedit_id].name = name; gpxedit.layersData[layer.gpxedit_id].comment = cmt; gpxedit.layersData[layer.gpxedit_id].description = desc; @@ -364,6 +366,7 @@ function drawLine(latlngs, name, desc, cmt){ weight: 7 }); var layer = onCreated('polyline', p); + p.bindTooltip(name, {sticky:true}); gpxedit.layersData[layer.gpxedit_id].name = name; gpxedit.layersData[layer.gpxedit_id].comment = cmt; gpxedit.layersData[layer.gpxedit_id].description = desc;