mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Use selected dropdown item as repeater title (#4544)
Credit to @DanHarrin. Initial implementation by @MattPurland. Finishes https://github.com/octobercms/october/pull/2956
This commit is contained in:
parent
ecf75e7e46
commit
3365820178
@ -211,9 +211,14 @@
|
||||
$target = $item
|
||||
}
|
||||
|
||||
var $textInput = $('input[type=text]:first', $target)
|
||||
var $textInput = $('input[type=text]:first, select:first', $target).first();
|
||||
if ($textInput.length) {
|
||||
return $textInput.val()
|
||||
switch($textInput.prop("tagName")) {
|
||||
case 'SELECT':
|
||||
return $textInput.find('option:selected').text();
|
||||
default:
|
||||
return $textInput.val();
|
||||
}
|
||||
} else {
|
||||
var $disabledTextInput = $('.text-field:first > .form-control', $target)
|
||||
if ($disabledTextInput.length) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user