mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 07:32:39 +01:00
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:
parent
7b506447c7
commit
f08668706f
@ -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),
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user