From d853899ab61866c3a1d42e2d3bf27bf5cee11e1f Mon Sep 17 00:00:00 2001
From: Joas Schilling <coding@schilljs.com>
Date: Tue, 20 Sep 2016 17:19:11 +0200
Subject: [PATCH] Hide the tags input field when it's empty

---
 apps/systemtags/js/systemtagsinfoview.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/apps/systemtags/js/systemtagsinfoview.js b/apps/systemtags/js/systemtagsinfoview.js
index a7320a3956f..ad09f3a68c8 100644
--- a/apps/systemtags/js/systemtagsinfoview.js
+++ b/apps/systemtags/js/systemtagsinfoview.js
@@ -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');
+						}
 					}
 				});
 			}
-- 
GitLab