diff --git a/app/assets/javascripts/app/controllers/notes.js b/app/assets/javascripts/app/controllers/notes.js index 027ef3540..bb17eb114 100644 --- a/app/assets/javascripts/app/controllers/notes.js +++ b/app/assets/javascripts/app/controllers/notes.js @@ -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() { diff --git a/app/assets/templates/notes.html.haml b/app/assets/templates/notes.html.haml index 244982892..5cb953f68 100644 --- a/app/assets/templates/notes.html.haml +++ b/app/assets/templates/notes.html.haml @@ -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