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?")) {
|
if(confirm("Are you sure you want to delete this note?")) {
|
||||||
this.remove()(this.note);
|
this.remove()(this.note);
|
||||||
this.showMenu = false;
|
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 */
|
/* Tags */
|
||||||
|
|
||||||
this.loadTagsString = function() {
|
this.loadTagsString = function() {
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ angular.module('app.frontend')
|
|||||||
this.showMenu = false;
|
this.showMenu = false;
|
||||||
}.bind(this))
|
}.bind(this))
|
||||||
|
|
||||||
|
$rootScope.$on("noteDeleted", function() {
|
||||||
|
this.selectFirstNote(false);
|
||||||
|
}.bind(this))
|
||||||
|
|
||||||
this.notesToDisplay = 20;
|
this.notesToDisplay = 20;
|
||||||
this.paginate = function() {
|
this.paginate = function() {
|
||||||
this.notesToDisplay += 20
|
this.notesToDisplay += 20
|
||||||
|
|||||||
Reference in New Issue
Block a user