Skip to content

Commit

Permalink
fix(ui): pqselect enabled not loaded every time it is needed (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
btry authored Oct 13, 2017
1 parent ec40d9f commit 22f3508
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
1 change: 0 additions & 1 deletion inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ public function showForm($ID, $options=[]) {
document.getElementById("validators_users").style.display = "none";
document.getElementById("validators_groups").style.display = "none";
}
fcInitMultiSelect();
}
$(document).ready(function() {changeValidators(' . $this->fields["validation_required"] . ');});';
echo Html::scriptBlock($script);
Expand Down
27 changes: 15 additions & 12 deletions js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,24 @@ function (response) {
$('.plugin_formcreator_sort input[value=mostPopularSort]')[0].checked = true;
}

fcInitMultiSelect();
});

function fcInitMultiSelect() {
// === Add better multi-select on form configuration validators ===
// initialize the pqSelect widget.
fcInitMultiSelect();

$('#tabspanel + div.ui-tabs').on("tabsload", function( event, ui ) {
$("#validator_users").pqSelect({
multiplePlaceholder: '----',
checkbox: true //adds checkbox to options
});
$("#validator_groups").pqSelect({
multiplePlaceholder: '----',
checkbox: true //adds checkbox to options
});
fcInitMultiSelect();
});

});

function fcInitMultiSelect() {
$("#validator_users").pqSelect({
multiplePlaceholder: '----',
checkbox: true //adds checkbox to options
});
$("#validator_groups").pqSelect({
multiplePlaceholder: '----',
checkbox: true //adds checkbox to options
});
}

Expand Down

0 comments on commit 22f3508

Please sign in to comment.