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

Version Path
decidim-core-0.26.8 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.27.4 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.27.3 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.7 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.5 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.27.2 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.27.1 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.4 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.27.0 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.3 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.27.0.rc2 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.27.0.rc1 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.2 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.1 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.0 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.0.rc2 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.26.0.rc1 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.25.2 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.25.1 app/packs/src/decidim/map/integration/forms.js
decidim-core-0.25.0 app/packs/src/decidim/map/integration/forms.js