1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 17:24:46 +02:00

Minor improvement to inputfields.js

This commit is contained in:
Ryan Cramer
2020-10-09 13:29:40 -04:00
parent 8dbfd4cca2
commit 60853ceda7
2 changed files with 10 additions and 3 deletions

View File

@@ -1375,18 +1375,25 @@ function InputfieldDependencies($target) {
// locate the dependency inputfield
var $inputfield = $("#Inputfield_" + f);
if ($inputfield.length == 0) {
if($inputfield.length == 0) {
consoleLog("Unable to find inputfield by: #Inputfield_" + f);
$inputfield = $("#" + f);
if($inputfield.length == 0) consoleLog("Unable to find inputfield by: #" + f);
}
// if the dependency inputfield isn't found, locate its wrapper..
if ($inputfield.length == 0) {
if($inputfield.length == 0) {
// use any inputs within the wrapper
$inputfield = $("#wrap_Inputfield_" + f).find(":input");
if($inputfield.length == 0) consoleLog("Unable to find inputfield by: #wrap_Inputfield_" + f + " :input");
}
// if the dependency inputfield isn't found, locate its wrapper..
if($inputfield.length == 0) {
// use any inputs within the wrapper
$inputfield = $("#wrap_" + f).find(":input");
if($inputfield.length == 0) consoleLog("Unable to find inputfield by: #wrap_" + f + " :input");
}
// attach change event to dependency inputfield
if($inputfield.length) {

File diff suppressed because one or more lines are too long