search fix

This commit is contained in:
Mo Bitar
2017-01-09 09:44:46 -06:00
parent 818f6aafe9
commit 24567cb87c
5 changed files with 9 additions and 20 deletions

View File

@@ -118,10 +118,11 @@ angular.module('app.frontend')
this.noteFilter = {text : ''};
this.filterNotes = function(note) {
if(this.noteFilter.text.length == 0) {
var filterText = this.noteFilter.text.toLowerCase();
if(filterText.length == 0) {
note.visible = true;
} else {
note.visible = note.title.toLowerCase().includes(this.noteFilter.text) || note.text.toLowerCase().includes(this.noteFilter.text);
note.visible = note.safeTitle().toLowerCase().includes(filterText) || note.safeText().toLowerCase().includes(filterText);
}
return note.visible;
}.bind(this)