Added ability for dropdown menu to be bottom of dom body

- 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.
This commit is contained in:
Dan Brown
2019-05-05 14:43:26 +01:00
parent ad542f0407
commit adc866cb3d
12 changed files with 66 additions and 33 deletions

View File

@ -126,7 +126,7 @@
<span>@icon('export')</span>
<span>{{ trans('entities.export') }}</span>
</div>
<ul class="wide">
<ul class="wide dropdown-menu">
<li><a href="{{ $book->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
<li><a href="{{ $book->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
<li><a href="{{ $book->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>

View File

@ -128,7 +128,7 @@
<span>@icon('export')</span>
<span>{{ trans('entities.export') }}</span>
</div>
<ul class="wide">
<ul class="wide dropdown-menu">
<li><a href="{{ $chapter->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
<li><a href="{{ $chapter->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
<li><a href="{{ $chapter->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>

View File

@ -29,7 +29,7 @@
@if(userCan('comment-delete', $comment))
<div dropdown class="dropdown-container">
<button type="button" dropdown-toggle class="text-button" title="{{ trans('common.delete') }}">@icon('delete')</button>
<ul>
<ul class="dropdown-menu">
<li class="px-m text-small text-muted pb-s">{{trans('entities.comment_delete_confirm')}}</li>
<li><a action="delete" class="text-button text-neg" >@icon('delete'){{ trans('common.delete') }}</a></li>
</ul>

View File

@ -53,7 +53,7 @@
<img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}">
<span class="name">{{ $currentUser->getShortName(9) }}</span> @icon('caret-down')
</span>
<ul>
<ul class="dropdown-menu">
<li>
<a href="{{ baseUrl("/user/{$currentUser->id}") }}">@icon('user'){{ trans('common.view_profile') }}</a>
</li>

View File

@ -20,10 +20,10 @@
</div>
<div class="text-center px-m py-xs">
<div v-show="draftsEnabled" dropdown class="dropdown-container draft-display text">
<a dropdown-toggle class="text-primary text-button"><span class="faded-text" v-text="draftText"></span>&nbsp; @icon('more')</a>
<div v-show="draftsEnabled" dropdown dropdown-move-menu class="dropdown-container draft-display text">
<a dropdown-toggle class="text-primary text-button"><span class="faded-text" v-text="draftText"></span>&nbsp; @icon('more')</a>
@icon('check-circle', ['class' => 'text-pos draft-notification svg-icon', ':class' => '{visible: draftUpdated}'])
<ul>
<ul class="dropdown-menu">
<li>
<a @click="saveDraft()" class="text-pos">@icon('save'){{ trans('entities.pages_edit_save_draft') }}</a>
</li>
@ -38,14 +38,15 @@
</div>
<div class="action-buttons px-m py-xs" v-cloak>
<div dropdown class="dropdown-container">
<div dropdown dropdown-move-menu class="dropdown-container">
<a dropdown-toggle class="text-primary text-button">@icon('edit') <span v-text="changeSummaryShort"></span></a>
<ul class="wide">
<ul class="wide dropdown-menu">
<li class="px-l py-m">
<p class="text-muted pb-s">{{ trans('entities.pages_edit_enter_changelog_desc') }}</p>
<input name="summary" id="summary-input" type="text" placeholder="{{ trans('entities.pages_edit_enter_changelog') }}" v-model="changeSummary" />
</li>
</ul>
<span>{{-- Prevents button jumping on menu show --}}</span>
</div>
<button type="submit" id="save-button" class="float-left text-primary text-button text-pos-hover">@icon('save')<span>{{ trans('entities.pages_save') }}</span></button>

View File

@ -53,7 +53,7 @@
<a href="{{ $revision->getUrl('restore') }}"></a>
<div dropdown class="dropdown-container">
<a dropdown-toggle>{{ trans('entities.pages_revisions_restore') }}</a>
<ul>
<ul class="dropdown-menu">
<li class="px-m py-s"><small class="text-muted">{{trans('entities.revision_restore_confirm')}}</small></li>
<li>
<form action="{{ $revision->getUrl('/restore') }}" method="POST">
@ -67,7 +67,7 @@
<span class="text-muted">&nbsp;|&nbsp;</span>
<div dropdown class="dropdown-container">
<a dropdown-toggle>{{ trans('common.delete') }}</a>
<ul>
<ul class="dropdown-menu">
<li class="px-m py-s"><small class="text-muted">{{trans('entities.revision_delete_confirm')}}</small></li>
<li>
<form action="{{ $revision->getUrl('/delete/') }}" method="POST">

View File

@ -171,7 +171,7 @@
<span>@icon('export')</span>
<span>{{ trans('entities.export') }}</span>
</div>
<ul class="wide">
<ul class="dropdown-menu wide">
<li><a href="{{ $page->getUrl('/export/html') }}" target="_blank">{{ trans('entities.export_html') }} <span class="text-muted float right">.html</span></a></li>
<li><a href="{{ $page->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
<li><a href="{{ $page->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.export_text') }} <span class="text-muted float right">.txt</span></a></li>

View File

@ -14,18 +14,14 @@
<div class="list-sort">
<div class="list-sort-type dropdown-container" dropdown>
<div dropdown-toggle>{{ $options[$selectedSort] }}</div>
<ul>
<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>
@if($order === 'desc')
@icon('sort-up')
@else
@icon('sort-down')
@endif
@icon($order === 'desc' ? 'sort-up' : 'sort-down')
</div>
</div>
</form>