From 460fcdf2f518c98a2b08a4cc089e1d2600fb3ab7 Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Mon, 30 Mar 2020 20:36:27 +0000 Subject: [PATCH] Limit the number of lines to display in card titles --- public/js/dots.js | 10 ++++++++++ src/views/index.ecr | 2 ++ src/views/title.ecr | 2 ++ 3 files changed, 14 insertions(+) create mode 100644 public/js/dots.js diff --git a/public/js/dots.js b/public/js/dots.js new file mode 100644 index 0000000..e31f681 --- /dev/null +++ b/public/js/dots.js @@ -0,0 +1,10 @@ +const truncate = () => { + $('.acard .uk-card-title').each((i, e) => { + new Dotdotdot(e, { + height: 120, + truncate: 'letter' + }); + }); +}; + +truncate(); diff --git a/src/views/index.ecr b/src/views/index.ecr index da2b89c..18175d7 100644 --- a/src/views/index.ecr +++ b/src/views/index.ecr @@ -46,6 +46,8 @@ <% content_for "script" do %> + + <% end %> diff --git a/src/views/title.ecr b/src/views/title.ecr index 98d63b0..8aef1fb 100644 --- a/src/views/title.ecr +++ b/src/views/title.ecr @@ -93,6 +93,8 @@ <% content_for "script" do %> + +