From f2dce42395426240d7f738f8b1862a04cc944e7e Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Fri, 9 Feb 2018 08:59:24 -0600 Subject: [PATCH] Fixes search in Archived issue, closes #179 --- app/assets/javascripts/app/controllers/notes.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/controllers/notes.js b/app/assets/javascripts/app/controllers/notes.js index 7f3289491..b04444c04 100644 --- a/app/assets/javascripts/app/controllers/notes.js +++ b/app/assets/javascripts/app/controllers/notes.js @@ -203,12 +203,7 @@ angular.module('app') this.noteFilter = {text : ''}; this.filterNotes = function(note) { - if(this.tag.archiveTag) { - note.visible = note.archived; - return note.visible; - } - - if((note.archived && !this.showArchived) || (note.pinned && this.hidePinned)) { + if((note.archived && !this.showArchived && !this.tag.archiveTag) || (note.pinned && this.hidePinned)) { note.visible = false; return note.visible; } @@ -222,6 +217,11 @@ angular.module('app') var matchesBody = words.every(function(word) { return note.safeText().toLowerCase().indexOf(word) >= 0; }); note.visible = matchesTitle || matchesBody; } + + if(this.tag.archiveTag) { + note.visible = note.visible && note.archived; + } + return note.visible; }.bind(this)