fix tagging issues

This commit is contained in:
Athou
2014-11-25 10:30:14 +01:00
parent 435fcb9669
commit ed81fc576a
3 changed files with 3 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ module.directive('tags', function() {
tags : [] tags : []
}; };
if (newValue) { if (newValue) {
data.tags = newValue.split(','); data.tags = newValue;
} }
EntryService.tag(data); EntryService.tag(data);
} }

View File

@@ -298,6 +298,7 @@ module.factory('EntryService', ['$resource', '$http', function($resource, $http)
$http.get('rest/entry/tags').success(function(data) { $http.get('rest/entry/tags').success(function(data) {
res.tags = []; res.tags = [];
res.tags.push.apply(res.tags, data); res.tags.push.apply(res.tags, data);
res.tags.sort();
}); });
}; };
var oldTag = res.tag; var oldTag = res.tag;

View File

@@ -7,6 +7,6 @@
<span class="label label-info" ng-repeat="tag in entry.tags">{{tag}}</span> <span class="label label-info" ng-repeat="tag in entry.tags">{{tag}}</span>
</span> </span>
<span ng-if="edit_mode"> <span ng-if="edit_mode">
<input type="text" ui-select2="select2Options" ng-model="entry.tags" class="tag-input" autofocus /> <input type="hidden" ui-select2="select2Options" ng-model="entry.tags" class="tag-input" autofocus />
</span> </span>
</span> </span>