mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
allow loading of lazy tabs for secondary tabs as well (#4839)
This commit is contained in:
parent
adb303a53c
commit
3a49b5fa7a
@ -465,8 +465,9 @@ class Form extends WidgetBase
|
||||
{
|
||||
$target = post('target');
|
||||
$tabName = post('name');
|
||||
$tabSection = post('section');
|
||||
|
||||
$fields = array_get(optional($this->getTab('primary'))->fields, $tabName);
|
||||
$fields = array_get(optional($this->getTab($tabSection))->fields, $tabName);
|
||||
|
||||
return [
|
||||
$target => $this->makePartial('form_fields', ['fields' => $fields]),
|
||||
|
@ -172,6 +172,7 @@
|
||||
data: {
|
||||
target: $el.data('target'),
|
||||
name: $el.data('tab-name'),
|
||||
section: $el.data('tab-section'),
|
||||
},
|
||||
success: function(data) {
|
||||
this.success(data)
|
||||
|
@ -18,7 +18,7 @@
|
||||
$lazy = in_array($name, $tabs->lazy);
|
||||
?>
|
||||
<li class="<?= ($index++ === 0) ? 'active' : '' ?> <?= $lazy ? 'tab-lazy' : '' ?>">
|
||||
<a href="#<?= $type . 'tab-' . $index ?>" data-tab-name="<?= e($name) ?>">
|
||||
<a href="#<?= $type . 'tab-' . $index ?>" data-tab-name="<?= e($name) ?>" data-tab-section="<?= $type ?>">
|
||||
<span class="title">
|
||||
<span>
|
||||
<?php if ($tabs->getIcon($name)): ?><span class="<?= $tabs->getIcon($name) ?>"></span><?php endif; ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user