diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-06-10 12:19:40 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2024-06-10 14:25:57 +0200 |
| commit | 00c397a92a3e8be45775a9e146d3d98a3bd784de (patch) | |
| tree | 0f55dba900c0d05173abb155309be5ea1ce543c4 /templates/sidebar | |
| parent | cad894ba042fcb3678b81c64edd4b305707b502f (diff) | |
fixes #4274
Closes #4274
Merge request studip/studip!3094
Diffstat (limited to 'templates/sidebar')
| -rw-r--r-- | templates/sidebar/search-widget.php | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/templates/sidebar/search-widget.php b/templates/sidebar/search-widget.php index 300147e..c314673 100644 --- a/templates/sidebar/search-widget.php +++ b/templates/sidebar/search-widget.php @@ -24,25 +24,24 @@ <? if ($needle['placeholder']) printf('placeholder="%s"', htmlReady($needle['label'])); ?> <?= arrayToHtmlAttributes($needle['attributes']) ?>> <? endif; ?> - <? if ($reset_link): ?> - <? if ($onsubmit) : ?> - <?= Icon::create('decline')->asInput([ - 'title' => _('Suche zurücksetzen'), - 'class' => 'reset-search', - 'onclick' => "window.document.getElementById('needle-".$hash."').value = '';" - ]) ?> - <? else : ?> - <a class="reset-search" href="<?= $reset_link ?>" tabindex="0" role="button" - <?= $onsubmit ? 'onclick="'."window.document.getElementById('needle-".$hash."').value = ''; window.document.getElementById('".$id."').submit(); return false; ".'"' : '' ?> - title="<?= _('Suche zurücksetzen') ?>"> - <?= Icon::create('decline')->asImg(20) ?> - </a> - <? endif ?> - <? endif; ?> <button type="submit" class="submit-search<?= $reset_link ? ' is-executed' : '' ?>" title="<?= _('Suche ausführen') ?>"> <?= Icon::create('search')->asImg(20) ?> </button> + <? if ($reset_link): ?> + <? if ($onsubmit) : ?> + <?= Icon::create('decline')->asInput([ + 'title' => _('Suche zurücksetzen'), + 'class' => 'reset-search', + 'onclick' => "document.getElementById('needle-".$hash."').value = ''; this.remove();" + ]) ?> + <? else : ?> + <a class="reset-search" href="<?= $reset_link ?>" tabindex="0" role="button" + title="<?= _('Suche zurücksetzen') ?>"> + <?= Icon::create('decline')->asImg(20) ?> + </a> + <? endif ?> + <? endif; ?> </li> <? endforeach; ?> </ul> |
