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.noteFilter = {text : ''};
this.filterNotes = function(note) { this.filterNotes = function(note) {
if(this.noteFilter.text.length == 0) { var filterText = this.noteFilter.text.toLowerCase();
if(filterText.length == 0) {
note.visible = true; note.visible = true;
} else { } 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; return note.visible;
}.bind(this) }.bind(this)

View File

@@ -1,6 +1,7 @@
$main-text-color: black; $main-text-color: black;
$secondary-text-color: rgba($main-text-color, 0.8); $secondary-text-color: rgba($main-text-color, 0.8);
$bg-color: #e3e3e3; $bg-color: #e3e3e3;
$light-bg-color: #e9e9e9;
$selection-color: $bg-color; $selection-color: $bg-color;
$selected-text-color: black; $selected-text-color: black;
$blue-color: #086dd6; $blue-color: #086dd6;

View File

@@ -25,7 +25,7 @@
margin-top: 20px; margin-top: 20px;
.filter-bar { .filter-bar {
background-color: $bg-color; background-color: $light-bg-color;
border-radius: 4px; border-radius: 4px;
height: 100%; height: 100%;
color: #909090; color: #909090;
@@ -39,20 +39,6 @@
} }
} }
.notes-footer {
border-top: 1px solid $bg-color;
position: absolute;
bottom: 0px;
margin-top: 1px solid $bg-color;
width: 100%;
text-align: center;
padding: 10px;
> .new-button {
}
}
.note { .note {
width: 100%; width: 100%;
padding: 15px; padding: 15px;

View File

@@ -1204,10 +1204,11 @@ angular.module('app.frontend').controller('BaseCtrl', BaseCtrl);
this.noteFilter = { text: '' }; this.noteFilter = { text: '' };
this.filterNotes = function (note) { this.filterNotes = function (note) {
if (this.noteFilter.text.length == 0) { var filterText = this.noteFilter.text.toLowerCase();
if (filterText.length == 0) {
note.visible = true; note.visible = true;
} else { } 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; return note.visible;
}.bind(this); }.bind(this);

File diff suppressed because one or more lines are too long