From 01cd47dd5e8cb1c6704324203ba5702b62143d8b Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 2 Jan 2021 19:49:49 +0100 Subject: [PATCH] fix: trim title in sidebar Fixes #8 --- components/sidebar/last-articles.php | 2 +- footer.php | 2 +- header.php | 2 ++ js/trim.js | 11 +++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 js/trim.js diff --git a/components/sidebar/last-articles.php b/components/sidebar/last-articles.php index 5f27e3b..62a4f8b 100644 --- a/components/sidebar/last-articles.php +++ b/components/sidebar/last-articles.php @@ -1,6 +1,6 @@
Publications
-
+
'postbypost', diff --git a/footer.php b/footer.php index 4020679..c290ad7 100644 --- a/footer.php +++ b/footer.php @@ -3,6 +3,6 @@ - + diff --git a/header.php b/header.php index f16ee99..cb7a007 100644 --- a/header.php +++ b/header.php @@ -24,6 +24,8 @@ + + diff --git a/js/trim.js b/js/trim.js new file mode 100644 index 0000000..7641199 --- /dev/null +++ b/js/trim.js @@ -0,0 +1,11 @@ +var length = 35; + +$(function(){ + $(".trim-that a, limit").each(function(i){ + len=$(this).text().length; + if(len>length) + { + $(this).text($(this).text().substr(0,(length-3))+'...'); + } + }); +});