From: Dan Brown Date: Sun, 16 Jun 2019 11:08:07 +0000 (+0100) Subject: Updated page-nav to show more title content X-Git-Tag: v0.27~1^2~45 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/f08668706f908ceea3c634d1d39cc5d9a01a1fd4 Updated page-nav to show more title content Will now be truncated using CSS instead of being truncated on PHP side. Closes #1206. --- diff --git a/app/Entities/Repos/PageRepo.php b/app/Entities/Repos/PageRepo.php index 21fe820d0..6b004984f 100644 --- a/app/Entities/Repos/PageRepo.php +++ b/app/Entities/Repos/PageRepo.php @@ -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), diff --git a/resources/assets/sass/_text.scss b/resources/assets/sass/_text.scss index 1a613898e..f1d165a47 100644 --- a/resources/assets/sass/_text.scss +++ b/resources/assets/sass/_text.scss @@ -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 */ diff --git a/resources/views/pages/show.blade.php b/resources/views/pages/show.blade.php index 0ae3fa5b6..fb0df2ddd 100644 --- a/resources/views/pages/show.blade.php +++ b/resources/views/pages/show.blade.php @@ -56,7 +56,7 @@