Desktop search on note change

This commit is contained in:
Mo Bitar
2018-03-28 17:18:47 -05:00
parent 603ea7ddef
commit 937d3f4947
2 changed files with 6 additions and 2 deletions

View File

@@ -184,12 +184,16 @@ angular.module('app')
}
}
this.selectNote = function(note) {
this.selectNote = function(note, viaClick = false) {
if(!note) { return; }
this.selectedNote = note;
note.conflict_of = null; // clear conflict
this.selectionMade()(note);
this.selectedIndex = this.visibleNotes().indexOf(note);
if(viaClick && this.noteFilter.text) {
desktopManager.searchText(this.noteFilter.text);
}
}
this.createNewNote = function() {

View File

@@ -43,7 +43,7 @@
.scrollable
.infinite-scroll#notes-scrollable{"infinite-scroll" => "ctrl.paginate()", "can-load" => "true", "threshold" => "200"}
.note{"ng-repeat" => "note in (ctrl.sortedNotes = (ctrl.tag.notes | filter: ctrl.filterNotes | sortBy: ctrl.sortBy | limitTo:ctrl.notesToDisplay)) track by note.uuid",
"ng-click" => "ctrl.selectNote(note)", "ng-class" => "{'selected' : ctrl.selectedNote == note}"}
"ng-click" => "ctrl.selectNote(note, true)", "ng-class" => "{'selected' : ctrl.selectedNote == note}"}
%strong.red.medium{"ng-if" => "note.conflict_of"} Conflicted copy
%strong.red.medium{"ng-if" => "note.errorDecrypting"} Error decrypting