autoselect tab with content

This commit is contained in:
Dennis Eichhorn 2021-01-31 17:18:46 +01:00
parent b10e5b00a2
commit 80b190ab3e
2 changed files with 5 additions and 5 deletions

View File

@ -60,7 +60,7 @@ class TextView extends View
* @var string
* @since 1.0.0
*/
private string $plain = '';
protected string $plain = '';
/**
* Preview content

View File

@ -1,10 +1,10 @@
<div id="<?= $this->renderId(); ?>" class="tabview tab-2 m-editor">
<ul class="tab-links">
<li><label tabindex="0" for="<?= $this->renderId(); ?>-c-tab-1"><?= $this->getHtml('Text', 'Editor'); ?></label>
<li><label tabindex="0" for="<?= $this->renderId(); ?>-c-tab-2"><?= $this->getHtml('Preview', 'Editor'); ?></label>
<li<?= !empty($this->plain) ? ' class="active"' : ''; ?>><label tabindex="0" for="<?= $this->renderId(); ?>-c-tab-2"><?= $this->getHtml('Preview', 'Editor'); ?></label>
</ul>
<div class="tab-content">
<input type="radio" id="<?= $this->renderId(); ?>-c-tab-1" name="tabular-1" checked>
<input type="radio" id="<?= $this->renderId(); ?>-c-tab-1" name="tabular-1">
<div class="tab">
<textarea
tabindex="0"
@ -17,9 +17,9 @@
<input type="hidden" id="<?= $this->renderId(); ?>-parsed">
</div>
<input type="radio" id="<?= $this->renderId(); ?>-c-tab-2" name="tabular-1">
<input type="radio" id="<?= $this->renderId(); ?>-c-tab-2" name="tabular-1"<?= !empty($this->plain) ? ' checked' : ''; ?>>
<div class="tab">
<article data-tpl-text="<?= $this->renderTplText(); ?>" data-tpl-value="<?= $this->renderTplValue(); ?>"><?= $this->renderPreview(); ?></article>
</div>
</div>
</div>
</div>