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

Update inputfields.js to support selection of Inputfield elements behaving as a tab

This commit is contained in:
Ryan Cramer
2021-07-09 11:01:26 -04:00
parent 405b80e54b
commit 2adebb6d78
2 changed files with 3 additions and 1 deletions

View File

@@ -519,6 +519,7 @@ var Inputfields = {
var hasNoFocus = $inputfield.hasClass('InputfieldNoFocus');
// Inputfields.toggle() can call Inputfields.focus(), so prevent the focus by adding this class
if(!hasNoFocus) $inputfield.addClass('InputfieldNoFocus');
if($inputfield.hasClass('WireTab') && !$inputfield.is(':visible')) $inputfield = $inputfield.find('.Inputfield');
this.toggle($inputfield, true, 0, function($in, open, duration) {
if(level > 9) return;
var timeout = level > 0 ? 10 * level : 0;
@@ -848,6 +849,7 @@ var Inputfields = {
var $in = jQuery(':input[name=' + $inputfield + ']');
if(!$in.length) $in = jQuery(':input[id=' + $inputfield + ']');
if(!$in.length) $in = jQuery(':input[name="' + $inputfield + '[]"]'); // array name
if(!$in.length) $in = jQuery('#' + $inputfield + '.Inputfield');
$inputfield = $in;
} else {
$inputfield = jQuery($inputfield)

File diff suppressed because one or more lines are too long