Skip to content

Commit

Permalink
Légendes des cartes cliquable #28
Browse files Browse the repository at this point in the history
  • Loading branch information
rafdulaf committed Mar 1, 2024
1 parent 4d23b76 commit e422ec9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Conan/maps/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Maps = mergeObject(Maps, {
for (var j=0; j < rules[i].coordinates.length; j++)
{
var coo = rules[i].coordinates[j];
aide += "<span class='map-help-legend' data-num='" + (i+1) + "' style='left: " + coo[0] + "%; top: " + coo[1] + "%;'>" + (i+1) + "</span>";
aide += "<span onclick='Maps._scrollIntoView(" + (i + 1) + ")' class='map-help-legend' data-num='" + (i+1) + "' style='left: " + coo[0] + "%; top: " + coo[1] + "%;'>" + (i+1) + "</span>";
}
}

Expand All @@ -98,6 +98,9 @@ Maps = mergeObject(Maps, {

return aide;
},
_scrollIntoView: function(number) {
$("*.map-help-rule-title[data-num='" + number + "']").parent()[0].scrollIntoView({ behavior: "smooth" });
},
_legendText: function(map)
{
var aide = "";
Expand Down

0 comments on commit e422ec9

Please sign in to comment.