mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 04:56:13 +00:00
Refactor variable declarations in pick-entity module.
Consolidated variable declarations into a single statement using const. This improves code readability and aligns with modern JavaScript best practices.
This commit is contained in:
parent
40eb71f95a
commit
7a9168fcdb
@ -12,10 +12,6 @@ function loadDynamicPicker(element) {
|
|||||||
let apps = element.querySelectorAll('[data-module="pick-dynamic"]');
|
let apps = element.querySelectorAll('[data-module="pick-dynamic"]');
|
||||||
|
|
||||||
apps.forEach(function (el) {
|
apps.forEach(function (el) {
|
||||||
let suggested;
|
|
||||||
let as_id;
|
|
||||||
let submit_on_adding_new_entity;
|
|
||||||
let label;
|
|
||||||
const isMultiple = parseInt(el.dataset.multiple) === 1,
|
const isMultiple = parseInt(el.dataset.multiple) === 1,
|
||||||
uniqId = el.dataset.uniqid,
|
uniqId = el.dataset.uniqid,
|
||||||
input = element.querySelector(
|
input = element.querySelector(
|
||||||
@ -26,11 +22,11 @@ function loadDynamicPicker(element) {
|
|||||||
? JSON.parse(input.value)
|
? JSON.parse(input.value)
|
||||||
: input.value === "[]" || input.value === ""
|
: input.value === "[]" || input.value === ""
|
||||||
? null
|
? null
|
||||||
: [JSON.parse(input.value)];
|
: [JSON.parse(input.value)],
|
||||||
suggested = JSON.parse(el.dataset.suggested);
|
suggested = JSON.parse(el.dataset.suggested),
|
||||||
as_id = parseInt(el.dataset.asId) === 1;
|
as_id = parseInt(el.dataset.asId) === 1,
|
||||||
submit_on_adding_new_entity =
|
submit_on_adding_new_entity =
|
||||||
parseInt(el.dataset.submitOnAddingNewEntity) === 1;
|
parseInt(el.dataset.submitOnAddingNewEntity) === 1,
|
||||||
label = el.dataset.label;
|
label = el.dataset.label;
|
||||||
|
|
||||||
if (!isMultiple) {
|
if (!isMultiple) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user