mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +02:00
Update inputfields.js to support selection of Inputfield elements behaving as a tab
This commit is contained in:
@@ -519,6 +519,7 @@ var Inputfields = {
|
|||||||
var hasNoFocus = $inputfield.hasClass('InputfieldNoFocus');
|
var hasNoFocus = $inputfield.hasClass('InputfieldNoFocus');
|
||||||
// Inputfields.toggle() can call Inputfields.focus(), so prevent the focus by adding this class
|
// Inputfields.toggle() can call Inputfields.focus(), so prevent the focus by adding this class
|
||||||
if(!hasNoFocus) $inputfield.addClass('InputfieldNoFocus');
|
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) {
|
this.toggle($inputfield, true, 0, function($in, open, duration) {
|
||||||
if(level > 9) return;
|
if(level > 9) return;
|
||||||
var timeout = level > 0 ? 10 * level : 0;
|
var timeout = level > 0 ? 10 * level : 0;
|
||||||
@@ -848,6 +849,7 @@ var Inputfields = {
|
|||||||
var $in = jQuery(':input[name=' + $inputfield + ']');
|
var $in = jQuery(':input[name=' + $inputfield + ']');
|
||||||
if(!$in.length) $in = jQuery(':input[id=' + $inputfield + ']');
|
if(!$in.length) $in = jQuery(':input[id=' + $inputfield + ']');
|
||||||
if(!$in.length) $in = jQuery(':input[name="' + $inputfield + '[]"]'); // array name
|
if(!$in.length) $in = jQuery(':input[name="' + $inputfield + '[]"]'); // array name
|
||||||
|
if(!$in.length) $in = jQuery('#' + $inputfield + '.Inputfield');
|
||||||
$inputfield = $in;
|
$inputfield = $in;
|
||||||
} else {
|
} else {
|
||||||
$inputfield = jQuery($inputfield)
|
$inputfield = jQuery($inputfield)
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user