mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 12:16:07 +00: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) {
|
$tree = collect($headers)->map(function($header) {
|
||||||
$text = trim(str_replace("\xc2\xa0", '', $header->nodeValue));
|
$text = trim(str_replace("\xc2\xa0", '', $header->nodeValue));
|
||||||
if (mb_strlen($text) > 30) {
|
$text = mb_substr($text, 0, 100);
|
||||||
$text = mb_substr($text, 0, 27) . '...';
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'nodeName' => strtolower($header->nodeName),
|
'nodeName' => strtolower($header->nodeName),
|
||||||
|
@ -329,6 +329,12 @@ li.checkbox-item, li.task-list-item {
|
|||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.limit-text {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grouping
|
* Grouping
|
||||||
*/
|
*/
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
<div class="sidebar-page-nav menu">
|
<div class="sidebar-page-nav menu">
|
||||||
@foreach($pageNav as $navItem)
|
@foreach($pageNav as $navItem)
|
||||||
<li class="page-nav-item h{{ $navItem['level'] }}">
|
<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>
|
<div class="primary-background sidebar-page-nav-bullet"></div>
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
Loading…
Reference in New Issue
Block a user