Updated page-nav to show more title content

Will now be truncated using CSS instead of being truncated on PHP side.
Closes #1206.
This commit is contained in:
Dan Brown 2019-06-16 12:08:07 +01:00
parent 7b506447c7
commit f08668706f
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 8 additions and 4 deletions

View File

@ -424,9 +424,7 @@ class PageRepo extends EntityRepo
$tree = collect($headers)->map(function($header) {
$text = trim(str_replace("\xc2\xa0", '', $header->nodeValue));
if (mb_strlen($text) > 30) {
$text = mb_substr($text, 0, 27) . '...';
}
$text = mb_substr($text, 0, 100);
return [
'nodeName' => strtolower($header->nodeName),

View File

@ -329,6 +329,12 @@ li.checkbox-item, li.task-list-item {
overflow-wrap: break-word;
}
.limit-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/**
* Grouping
*/

View File

@ -56,7 +56,7 @@
<div class="sidebar-page-nav menu">
@foreach($pageNav as $navItem)
<li class="page-nav-item h{{ $navItem['level'] }}">
<a href="{{ $navItem['link'] }}">{{ $navItem['text'] }}</a>
<a href="{{ $navItem['link'] }}" class="limit-text block">{{ $navItem['text'] }}</a>
<div class="primary-background sidebar-page-nav-bullet"></div>
</li>
@endforeach