Skip to content

Commit 22f3508

Browse files
authored
fix(ui): pqselect enabled not loaded every time it is needed (#768)
1 parent ec40d9f commit 22f3508

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

inc/form.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ public function showForm($ID, $options=[]) {
451451
document.getElementById("validators_users").style.display = "none";
452452
document.getElementById("validators_groups").style.display = "none";
453453
}
454-
fcInitMultiSelect();
455454
}
456455
$(document).ready(function() {changeValidators(' . $this->fields["validation_required"] . ');});';
457456
echo Html::scriptBlock($script);

js/scripts.js.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,24 @@ function (response) {
135135
$('.plugin_formcreator_sort input[value=mostPopularSort]')[0].checked = true;
136136
}
137137

138-
fcInitMultiSelect();
139-
});
140-
141-
function fcInitMultiSelect() {
142138
// === Add better multi-select on form configuration validators ===
143139
// initialize the pqSelect widget.
140+
fcInitMultiSelect();
141+
144142
$('#tabspanel + div.ui-tabs').on("tabsload", function( event, ui ) {
145-
$("#validator_users").pqSelect({
146-
multiplePlaceholder: '----',
147-
checkbox: true //adds checkbox to options
148-
});
149-
$("#validator_groups").pqSelect({
150-
multiplePlaceholder: '----',
151-
checkbox: true //adds checkbox to options
152-
});
143+
fcInitMultiSelect();
144+
});
145+
146+
});
147+
148+
function fcInitMultiSelect() {
149+
$("#validator_users").pqSelect({
150+
multiplePlaceholder: '----',
151+
checkbox: true //adds checkbox to options
152+
});
153+
$("#validator_groups").pqSelect({
154+
multiplePlaceholder: '----',
155+
checkbox: true //adds checkbox to options
153156
});
154157
}
155158

0 commit comments

Comments
 (0)