From e06b98059f6b6f44e43295e9026cec35a205a6bc Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Sat, 21 Jan 2017 19:35:26 -0600 Subject: [PATCH] note preview, closes #1 --- app/assets/stylesheets/app/_notes.scss | 16 +++++++++++++++- app/assets/templates/frontend/notes.html.haml | 4 +++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/app/_notes.scss b/app/assets/stylesheets/app/_notes.scss index 7ded2c444..6cb3adcce 100644 --- a/app/assets/stylesheets/app/_notes.scss +++ b/app/assets/stylesheets/app/_notes.scss @@ -41,8 +41,9 @@ .note { width: 100%; + // max-width: 100%; padding: 15px; - height: 70px; + // height: 70px; border-bottom: 1px solid $bg-color; cursor: pointer; background-color: white; @@ -58,6 +59,19 @@ margin-top: 4px; } + .note-preview { + font-size: 15px; + margin-top: 1px; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; /* number of lines to show */ + $line-height: 18px; + line-height: $line-height; /* fallback */ + max-height: calc(#{$line-height} * 1); /* fallback */ + } + &.selected { background-color: $blue-color; color: white; diff --git a/app/assets/templates/frontend/notes.html.haml b/app/assets/templates/frontend/notes.html.haml index 48f42dc83..0d5b71103 100644 --- a/app/assets/templates/frontend/notes.html.haml +++ b/app/assets/templates/frontend/notes.html.haml @@ -20,6 +20,8 @@ .note{"ng-repeat" => "note in ctrl.tag.notes | filter: ctrl.filterNotes", "ng-click" => "ctrl.selectNote(note)", "ng-class" => "{'selected' : ctrl.selectedNote == note}"} - .name + .name{"ng-if" => "note.title"} {{note.title}} + .note-preview + {{note.text}} .date {{(note.created_at | appDateTime) || 'Now'}}