mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-28 20:00:47 +08:00
adc866cb3d
- Used when a dropdown is within a scrollable section such as editor toolbar on mobile. - Also made mobile page save button more obvious by increasing size and inverting color.
28 lines
1.3 KiB
PHP
28 lines
1.3 KiB
PHP
<?php
|
|
$selectedSort = (isset($sort) && array_key_exists($sort, $options)) ? $sort : array_keys($options)[0];
|
|
$order = (isset($order) && in_array($order, ['asc', 'desc'])) ? $order : 'asc';
|
|
?>
|
|
<div class="list-sort-container" list-sort-control>
|
|
<div class="list-sort-label">{{ trans('common.sort') }}</div>
|
|
<form action="{{ baseUrl("/settings/users/{$currentUser->id}/change-sort/{$type}") }}" method="post">
|
|
|
|
{!! csrf_field() !!}
|
|
{!! method_field('PATCH') !!}
|
|
<input type="hidden" value="{{ $selectedSort }}" name="sort">
|
|
<input type="hidden" value="{{ $order }}" name="order">
|
|
|
|
<div class="list-sort">
|
|
<div class="list-sort-type dropdown-container" dropdown>
|
|
<div dropdown-toggle>{{ $options[$selectedSort] }}</div>
|
|
<ul class="dropdown-menu">
|
|
@foreach($options as $key => $label)
|
|
<li @if($key === $selectedSort) class="active" @endif><a href="#" data-sort-value="{{$key}}">{{ $label }}</a></li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
<div class="list-sort-dir" data-sort-dir>
|
|
@icon($order === 'desc' ? 'sort-up' : 'sort-down')
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|