auto delete conflicts and show conflict flag

This commit is contained in:
Mo Bitar
2017-04-21 11:19:14 -05:00
parent ad92c0894d
commit ea77ef99bf
8 changed files with 31 additions and 6 deletions

View File

@@ -105,16 +105,13 @@ angular.module('app.frontend')
*/
$scope.removeTag = function(tag) {
var validNotes = Note.filterDummyNotes(tag.notes);
if(validNotes == 0) {
if(confirm("Are you sure you want to delete this tag?")) {
modelManager.setItemToBeDeleted(tag);
// if no more notes, delete tag
syncManager.sync(function(){
// force scope tags to update on sub directives
$scope.safeApply();
});
} else {
alert("To delete this tag, remove all its notes first.");
}
}