Merge pull request #67 from amtsh/after-delete-select-first
After deleting a note, it should select the first note on top
This commit is contained in:
@@ -224,9 +224,21 @@ angular.module('app.frontend')
|
||||
if(confirm("Are you sure you want to delete this note?")) {
|
||||
this.remove()(this.note);
|
||||
this.showMenu = false;
|
||||
this.notifyDelete();
|
||||
}
|
||||
}
|
||||
|
||||
this.notifyDelete = function() {
|
||||
$timeout(function() {
|
||||
$rootScope.$broadcast("noteDeleted");
|
||||
}.bind(this), 500);
|
||||
}
|
||||
|
||||
this.clickedEditNote = function() {
|
||||
this.editorMode = 'edit';
|
||||
this.focusEditor(100);
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
|
||||
this.loadTagsString = function() {
|
||||
|
||||
@@ -41,6 +41,10 @@ angular.module('app.frontend')
|
||||
this.showMenu = false;
|
||||
}.bind(this))
|
||||
|
||||
$rootScope.$on("noteDeleted", function() {
|
||||
this.selectFirstNote(false);
|
||||
}.bind(this))
|
||||
|
||||
this.notesToDisplay = 20;
|
||||
this.paginate = function() {
|
||||
this.notesToDisplay += 20
|
||||
|
||||
Reference in New Issue
Block a user