From 7745b1ac298d53ee1a600c3108161603c589a868 Mon Sep 17 00:00:00 2001 From: Joas Schilling 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'); + } } }); } -- 2.39.5