From 4508ecdecdd9641bc52a1442b0a8f3422e82d9b1 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Sat, 11 May 2019 17:55:01 -0500 Subject: [PATCH] ng-if instead of ng-show for previews --- app/assets/templates/notes.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/templates/notes.html.haml b/app/assets/templates/notes.html.haml index 4575da770..0fafdf70c 100644 --- a/app/assets/templates/notes.html.haml +++ b/app/assets/templates/notes.html.haml @@ -56,7 +56,8 @@ .name{"ng-show" => "note.title"} {{note.title}} - .note-preview{"ng-show" => "!ctrl.hideNotePreview && !note.content.hidePreview && !note.content.protected"} + -# Use ng-if and not ng-show here. We don't want previews in the dom at all if protected. + .note-preview{"ng-if" => "!ctrl.hideNotePreview && !note.content.hidePreview && !note.content.protected"} .html-preview{"ng-show" => "note.content.preview_html", "ng-bind-html" => "note.content.preview_html"} .plain-preview{"ng-show" => "!note.content.preview_html && note.content.preview_plain"} {{note.content.preview_plain}} .default-preview{"ng-show" => "!note.content.preview_html && !note.content.preview_plain"} {{note.text}}