Fix autofocus: load bulk action input on linklist only (#1976)

This commit is contained in:
ArthurHoaro 2023-04-15 12:46:09 -04:00 committed by GitHub
parent 1cd642619f
commit 88b76c44f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,59 +117,62 @@
<button type="submit" class="search-button" aria-label="{'Search'|t}"><i class="fa fa-search" aria-hidden="true"></i></button> <button type="submit" class="search-button" aria-label="{'Search'|t}"><i class="fa fa-search" aria-hidden="true"></i></button>
</form> </form>
</div> </div>
<div id="actions" class="subheader-form">
<div class="pure-g"> {if="$is_logged_in && $template === 'linklist'"}
<div class="pure-u-1"> <div id="actions" class="subheader-form">
<a href="" id="actions-delete" class="button"> <div class="pure-g">
<i class="fa fa-trash" aria-hidden="true"></i> <div class="pure-u-1">
{'Delete'|t} <a href="" id="actions-delete" class="button">
</a>&nbsp; <i class="fa fa-trash" aria-hidden="true"></i>
<a href="" class="actions-change-visibility button" data-visibility="public"> {'Delete'|t}
<i class="fa fa-globe" aria-hidden="true"></i> </a>&nbsp;
{'Set public'|t} <a href="" class="actions-change-visibility button" data-visibility="public">
</a>&nbsp; <i class="fa fa-globe" aria-hidden="true"></i>
<a href="" class="actions-change-visibility button" data-visibility="private"> {'Set public'|t}
<i class="fa fa-user-secret" aria-hidden="true"></i> </a>&nbsp;
{'Set private'|t} <a href="" class="actions-change-visibility button" data-visibility="private">
</a>&nbsp; <i class="fa fa-user-secret" aria-hidden="true"></i>
<a href="" class="subheader-opener button" data-open-id="bulk-tag-action-add"> {'Set private'|t}
<i class="fa fa-tag" aria-hidden="true"></i> </a>&nbsp;
{'Add tags'|t} <a href="" class="subheader-opener button" data-open-id="bulk-tag-action-add">
</a>&nbsp; <i class="fa fa-tag" aria-hidden="true"></i>
<a href="" class="subheader-opener button" data-open-id="bulk-tag-action-delete"> {'Add tags'|t}
<i class="fa fa-window-close" aria-hidden="true"></i> </a>&nbsp;
{'Delete tags'|t} <a href="" class="subheader-opener button" data-open-id="bulk-tag-action-delete">
</a> <i class="fa fa-window-close" aria-hidden="true"></i>
{'Delete tags'|t}
</a>
</div>
</div> </div>
</div> </div>
</div>
{$addDelete=['add', 'delete']} {$addDelete=['add', 'delete']}
{loop="$addDelete"} {loop="$addDelete"}
<div id="bulk-tag-action-{$value}" class="subheader-form"> <div id="bulk-tag-action-{$value}" class="subheader-form">
<form class="pure-g" action="{$base_path}/admin/shaare/update-tags" method="post"> <form class="pure-g" action="{$base_path}/admin/shaare/update-tags" method="post">
<div class="pure-u-1"> <div class="pure-u-1">
<span> <span>
<input <input
type="text" name="tag" class="autofocus" type="text" name="tag" class="autofocus"
aria-label="{$value === 'add' ? t('Tag to add') : t('Tag to delete')}" aria-label="{$value === 'add' ? t('Tag to add') : t('Tag to delete')}"
placeholder="{$value === 'add' ? t('Tag to add') : t('Tag to delete')}" placeholder="{$value === 'add' ? t('Tag to add') : t('Tag to delete')}"
autocomplete="off" data-multiple data-autofirst data-minChars="1" autocomplete="off" data-multiple data-autofirst data-minChars="1"
data-list="{loop="$tags"}{$key}, {/loop}" data-list="{loop="$tags"}{$key}, {/loop}"
> >
<input type="hidden" name="action" value="{$value}" /> <input type="hidden" name="action" value="{$value}" />
<input type="hidden" name="id" value="" /> <input type="hidden" name="id" value="" />
<input type="hidden" name="token" value="{$token}" /> <input type="hidden" name="token" value="{$token}" />
</span>&nbsp; </span>&nbsp;
<a href="" class="button action"> <a href="" class="button action">
<i class="fa fa-tag" aria-hidden="true"></i> <i class="fa fa-tag" aria-hidden="true"></i>
{$value === 'add' ? t('Add tag') : t('Delete tag')} {$value === 'add' ? t('Add tag') : t('Delete tag')}
</a>&nbsp; </a>&nbsp;
<a href="" class="subheader-opener button cancel" data-open-id="actions">{'Cancel'|t}</a> <a href="" class="subheader-opener button cancel" data-open-id="actions">{'Cancel'|t}</a>
</div> </div>
</form> </form>
</div> </div>
{/loop} {/loop}
{/if}
{if="!$is_logged_in"} {if="!$is_logged_in"}
<form method="post" name="loginform"> <form method="post" name="loginform">