1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 09:14:58 +02:00

Fix issue processwire/processwire-issues#1010 add support for dependencies to InputfieldPageListSelectMultiple and InputfieldPageAutocomplete

This commit is contained in:
Ryan Cramer
2019-11-05 10:46:56 -05:00
parent ceca16506a
commit c9713f0bc4
4 changed files with 28 additions and 5 deletions

View File

@@ -1098,6 +1098,8 @@ function InputfieldDependencies($target) {
consoleLog("Unable to locate field: " + conditionField);
continue;
}
var $inputfield = $field.closest('.Inputfield');
// value of the dependency field we are checking (if not already populated above)
if (value === null) {
@@ -1123,9 +1125,12 @@ function InputfieldDependencies($target) {
if (typeof value == 'object') {
// object, convert to array
values = jQuery.makeArray(value);
} else if (typeof value == 'array') {
} else if(typeof value == 'array') {
// array, already
values = value;
} else if(typeof value == "string" && $inputfield.hasClass('InputfieldPage') && value.indexOf(',') > -1 && value.match(/^[,0-9]+$/)) {
// CSV string of page IDs
values = value.split(',');
} else {
// string: single value array
values[0] = value;

File diff suppressed because one or more lines are too long