tag deletion

This commit is contained in:
Mo Bitar
2016-12-26 01:19:00 -06:00
parent e3ea390abd
commit 9f13f659cc
5 changed files with 7 additions and 5 deletions

View File

@@ -73,8 +73,9 @@ angular.module('app.frontend')
$scope.notesRemoveTag = function(tag) { $scope.notesRemoveTag = function(tag) {
var validNotes = Note.filterDummyNotes(tag.notes); var validNotes = Note.filterDummyNotes(tag.notes);
if(validNotes == 0) { if(validNotes == 0) {
modelManager.deleteTag(tag);
// if no more notes, delete tag // if no more notes, delete tag
apiController.deleteItem($scope.defaultUser, tag, function(){ apiController.deleteItem(tag, function(){
// force scope tags to update on sub directives // force scope tags to update on sub directives
$scope.tags = []; $scope.tags = [];
$timeout(function(){ $timeout(function(){

View File

@@ -55,7 +55,7 @@
font-size: 12px; font-size: 12px;
text-transform: none; text-transform: none;
font-weight: normal; font-weight: normal;
margin-top: -18px; margin-top: 4px;
width: 120px; width: 120px;
text-align: right; text-align: right;
color: rgba(black, 0.5); color: rgba(black, 0.5);

View File

@@ -58,7 +58,7 @@
font-weight: bold; font-weight: bold;
} }
$tags-selected-color: #bdbdbd; $tags-selected-color: #dbdbdb;
&.selected { &.selected {
background-color: $tags-selected-color; background-color: $tags-selected-color;

View File

@@ -927,8 +927,9 @@ angular.module('app.frontend').controller('BaseCtrl', BaseCtrl);
$scope.notesRemoveTag = function (tag) { $scope.notesRemoveTag = function (tag) {
var validNotes = Note.filterDummyNotes(tag.notes); var validNotes = Note.filterDummyNotes(tag.notes);
if (validNotes == 0) { if (validNotes == 0) {
modelManager.deleteTag(tag);
// if no more notes, delete tag // if no more notes, delete tag
apiController.deleteItem($scope.defaultUser, tag, function () { apiController.deleteItem(tag, function () {
// force scope tags to update on sub directives // force scope tags to update on sub directives
$scope.tags = []; $scope.tags = [];
$timeout(function () { $timeout(function () {

File diff suppressed because one or more lines are too long