Sha256: b67a1b209e4a9c70215b3d39c77ba4c4e81e8c18a12d0868cd9d91d56babeccd

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

import createFieldDependentInputs from "src/decidim/admin/field_dependent_inputs.component"

$(() => {
  const $assemblyMemberType = $("#assembly_member_existing_user");

  createFieldDependentInputs({
    controllerField: $assemblyMemberType,
    wrapperSelector: ".user-fields",
    dependentFieldsSelector: ".user-fields--full-name",
    dependentInputSelector: "input",
    enablingCondition: ($field) => {
      return $field.val() === "false"
    }
  });

  createFieldDependentInputs({
    controllerField: $assemblyMemberType,
    wrapperSelector: ".user-fields",
    dependentFieldsSelector: ".user-fields--user-picker",
    dependentInputSelector: "input",
    enablingCondition: ($field) => {
      return $field.val() === "true"
    }
  });

  const $assemblyMemberPosition = $("#assembly_member_position");

  createFieldDependentInputs({
    controllerField: $assemblyMemberPosition,
    wrapperSelector: ".position-fields",
    dependentFieldsSelector: ".position-fields--position-other",
    dependentInputSelector: "input",
    enablingCondition: ($field) => {
      return $field.val() === "other"
    }
  });
})

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-assemblies-0.25.2 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.25.1 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.25.0 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.25.0.rc4 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.25.0.rc3 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.25.0.rc2 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.25.0.rc1 app/packs/src/decidim/assemblies/admin/assembly_members.js