Hide the tags input field when it's empty

This commit is contained in:
Joas Schilling 2016-09-20 17:19:11 +02:00
parent bbe8f4ed0d
commit 7745b1ac29
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 9 additions and 2 deletions

View File

@ -118,8 +118,15 @@
this.selectedTagsCollection.fetch({
success: function(collection) {
collection.fetched = true;
self._inputView.setData(collection.map(modelToSelection));
self.$el.removeClass('hidden');
var appliedTags = collection.map(modelToSelection);
self._inputView.setData(appliedTags);
if (appliedTags.length !== 0) {
self.$el.removeClass('hidden');
} else {
self.$el.addClass('hidden');
}
}
});
}