Sha256: 04e8c7b75765e82ac904070a35973dd5242670d0e631bd31fc50871911609179

Contents?: true

Size: 1.39 KB

Versions: 37

Compression:

Stored size: 1.39 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--non-user-avatar",
    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

37 entries across 37 versions & 1 rubygems

Version Path
decidim-assemblies-0.29.1 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.28.4 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.27.9 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.29.0 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.28.3 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.27.8 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.29.0.rc4 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.29.0.rc3 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.29.0.rc2 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.29.0.rc1 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.28.2 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.27.7 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.28.1 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.27.6 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.26.10 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.26.9 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.28.0 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.27.5 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.28.0.rc5 app/packs/src/decidim/assemblies/admin/assembly_members.js
decidim-assemblies-0.28.0.rc4 app/packs/src/decidim/assemblies/admin/assembly_members.js