Sha256: d09f81a70f45341432b0417ed62c46be1d5dc42a1a3bce7cb005dc0a1bf06e65
Contents?: true
Size: 769 Bytes
Versions: 44
Compression:
Stored size: 769 Bytes
Contents
$(() => { $("[data-decidim-map]").on("ready.decidim", (ev, _map, mapConfig) => { const $map = $(ev.target); const ctrl = $map.data("map-controller"); if (mapConfig.type === "drag-marker") { const inputSelector = $map.data("connected-input"); if (!inputSelector) { return; } const $inputs = $(inputSelector); if ($inputs.length < 1) { return; } ctrl.setEventHandler("coordinates", (latlng) => { $inputs.each((_i, el) => { const $input = $(el); if ($input.data("type") === "latitude") { $input.val(latlng.lat); } else if ($input.data("type") === "longitude") { $input.val(latlng.lng); } }) }); } }); });
Version data entries
44 entries across 44 versions & 1 rubygems