mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 17:54:44 +02:00
Minor improvement to inputfields.js
This commit is contained in:
@@ -1375,19 +1375,26 @@ function InputfieldDependencies($target) {
|
|||||||
|
|
||||||
// locate the dependency inputfield
|
// locate the dependency inputfield
|
||||||
var $inputfield = $("#Inputfield_" + f);
|
var $inputfield = $("#Inputfield_" + f);
|
||||||
if ($inputfield.length == 0) {
|
if($inputfield.length == 0) {
|
||||||
consoleLog("Unable to find inputfield by: #Inputfield_" + f);
|
consoleLog("Unable to find inputfield by: #Inputfield_" + f);
|
||||||
$inputfield = $("#" + f);
|
$inputfield = $("#" + f);
|
||||||
if($inputfield.length == 0) consoleLog("Unable to find inputfield by: #" + f);
|
if($inputfield.length == 0) consoleLog("Unable to find inputfield by: #" + f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the dependency inputfield isn't found, locate its wrapper..
|
// if the dependency inputfield isn't found, locate its wrapper..
|
||||||
if ($inputfield.length == 0) {
|
if($inputfield.length == 0) {
|
||||||
// use any inputs within the wrapper
|
// use any inputs within the wrapper
|
||||||
$inputfield = $("#wrap_Inputfield_" + f).find(":input");
|
$inputfield = $("#wrap_Inputfield_" + f).find(":input");
|
||||||
if($inputfield.length == 0) consoleLog("Unable to find inputfield by: #wrap_Inputfield_" + f + " :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
|
// attach change event to dependency inputfield
|
||||||
if($inputfield.length) {
|
if($inputfield.length) {
|
||||||
consoleLog('Attaching change event for: ' + $inputfield.attr('name'));
|
consoleLog('Attaching change event for: ' + $inputfield.attr('name'));
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user