Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Optimize display of long titles in edit forms #10988

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions resources/css/core/utilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
width: fit-content;
}

.break-overflowing-words {
word-break: break-word;
overflow-wrap: break-word;
}

.saving-overlay {
@apply absolute inset-0 z-200 flex items-center rounded;
background: rgba(255, 255, 255, .9);
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/GlobalSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<div v-show="focused && (hasResults || hasFavorites)" class="global-search-results">

<div v-if="hasResults" v-for="(result, index) in results" class="global-search-result-item p-2 flex items-center" :class="{ 'active': current == index }" @click="hit" @mousemove="setActive(index)">
<div v-if="hasResults" v-for="(result, index) in results" class="global-search-result-item break-overflowing-words p-2 flex items-start" :class="{ 'active': current == index }" @click="hit" @mousemove="setActive(index)">
<svg-icon :name="`light/${getResultIcon(result)}`" class="icon"></svg-icon>
<div class="flex-1 rtl:mr-2 ltr:ml-2 title" v-html="result.title"></div>
<span class="global-search-result-badge" v-text="result.badge" />
Expand Down
10 changes: 5 additions & 5 deletions resources/js/components/entries/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<div>
<breadcrumb v-if="breadcrumbs" :url="breadcrumbs[1].url" :title="breadcrumbs[1].text" />

<div class="flex items-center mb-6">
<h1 class="flex-1">
<div class="flex items-center">
<span v-if="! isCreating" class="little-dot rtl:ml-2 ltr:mr-2" :class="activeLocalization.status" v-tooltip="__(activeLocalization.status)" />
<span v-html="$options.filters.striptags(__(title))" />
<div class="flex items-baseline mb-6">
<h1 class="flex-1 self-start rtl:ml-4 ltr:mr-4">
<div class="flex items-baseline">
<span v-if="! isCreating" class="little-dot rtl:ml-2 ltr:mr-2 -top-1" :class="activeLocalization.status" v-tooltip="__(activeLocalization.status)" />
<span class="break-overflowing-words" v-html="$options.filters.striptags(__(title))" />
</div>
</h1>

Expand Down
10 changes: 5 additions & 5 deletions resources/js/components/terms/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<div>
<breadcrumb v-if="breadcrumbs" :url="breadcrumbs[1].url" :title="breadcrumbs[1].text" />

<div class="flex items-center mb-6">
<h1 class="flex-1">
<div class="flex items-center">
<div class="flex items-baseline mb-6">
<h1 class="flex-1 self-start rtl:ml-4 ltr:mr-4">
<div class="flex items-baseline">
<span v-if="! isCreating"
class="little-dot rtl:ml-2 ltr:mr-2"
class="little-dot rtl:ml-2 ltr:mr-2 -top-1"
:class="{ 'bg-green-600': published, 'bg-gray-600': !published }" />
<span v-html="$options.filters.striptags(title)" />
<span class="break-overflowing-words" v-html="$options.filters.striptags(title)" />
</div>
</h1>

Expand Down
Loading