From 7745b1ac298d53ee1a600c3108161603c589a868 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Sep 2016 17:19:11 +0200 Subject: [PATCH 1/5] 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 a7320a3956f35..ad09f3a68c884 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'); + } } }); } From 781feb9ff7e7a54cd187968da1a246f76453cff6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Sep 2016 17:20:09 +0200 Subject: [PATCH 2/5] Add a handle for the tags label --- apps/systemtags/css/systemtagsfilelist.css | 9 +++++++++ apps/systemtags/js/systemtagsinfoview.js | 17 +++++++++++++++++ core/css/icons.css | 4 ++++ core/img/actions/tag.svg | 5 +++++ 4 files changed, 35 insertions(+) create mode 100644 core/img/actions/tag.svg diff --git a/apps/systemtags/css/systemtagsfilelist.css b/apps/systemtags/css/systemtagsfilelist.css index e8fb665e26b38..32cce759ec23e 100644 --- a/apps/systemtags/css/systemtagsfilelist.css +++ b/apps/systemtags/css/systemtagsfilelist.css @@ -27,3 +27,12 @@ .nav-icon-systemtagsfilter { background-image: url('../img/tag.svg'); } + +#app-sidebar .mainFileInfoView .tag-label { + cursor: pointer; +} + +#app-sidebar .mainFileInfoView .icon-tag { + opacity: .5; + vertical-align: middle; +} diff --git a/apps/systemtags/js/systemtagsinfoview.js b/apps/systemtags/js/systemtagsinfoview.js index ad09f3a68c884..ce41bc504e271 100644 --- a/apps/systemtags/js/systemtagsinfoview.js +++ b/apps/systemtags/js/systemtagsinfoview.js @@ -37,6 +37,8 @@ */ _inputView: null, + _toggleHandle: null, + initialize: function(options) { var self = this; options = options || {}; @@ -58,6 +60,9 @@ this._inputView.on('select', this._onSelectTag, this); this._inputView.on('deselect', this._onDeselectTag, this); + + this._toggleHandle = $('').addClass('tag-label').text(t('systemtags', 'Tags')); + this._toggleHandle.prepend($('').addClass('icon icon-tag')); }, /** @@ -130,6 +135,7 @@ } }); } + this.$el.addClass('hidden'); }, @@ -137,12 +143,23 @@ * Renders this details view */ render: function() { + var self = this; + this.$el.append(this._inputView.$el); this._inputView.render(); + + $('#app-sidebar').find('.mainFileInfoView .file-details').append(this._toggleHandle); + this._toggleHandle.off('click'); + this._toggleHandle.on('click', function () { + console.log('toggle'); + console.log(self.$el); + self.$el.toggleClass('hidden'); + }); }, remove: function() { this._inputView.remove(); + this._toggleHandle.remove(); } }); diff --git a/core/css/icons.css b/core/css/icons.css index d1ef86a94d05a..6cfe67c3a4d93 100644 --- a/core/css/icons.css +++ b/core/css/icons.css @@ -284,6 +284,10 @@ img.icon-loading-small-dark, object.icon-loading-small-dark, video.icon-loading- background-image: url('../img/actions/starred.svg?v=1'); } +.icon-tag { + background-image: url('../img/actions/tag.svg?v=1'); +} + .icon-toggle { background-image: url('../img/actions/toggle.svg?v=1'); } diff --git a/core/img/actions/tag.svg b/core/img/actions/tag.svg new file mode 100644 index 0000000000000..293a7f5be9cad --- /dev/null +++ b/core/img/actions/tag.svg @@ -0,0 +1,5 @@ + + + + + From 96dc2feb1e2c4db4f42fa414a262065412c032f4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Sep 2016 18:45:55 +0200 Subject: [PATCH 3/5] Add viewbox to icons --- apps/systemtags/img/tag.svg | 2 +- core/img/actions/tag.svg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/systemtags/img/tag.svg b/apps/systemtags/img/tag.svg index 293a7f5be9cad..d95ddbcc5a0e7 100644 --- a/apps/systemtags/img/tag.svg +++ b/apps/systemtags/img/tag.svg @@ -1,5 +1,5 @@ - + diff --git a/core/img/actions/tag.svg b/core/img/actions/tag.svg index 293a7f5be9cad..d95ddbcc5a0e7 100644 --- a/core/img/actions/tag.svg +++ b/core/img/actions/tag.svg @@ -1,5 +1,5 @@ - + From fa912b43ae43a994076554614ed3ed2bbacfad42 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 21 Sep 2016 00:22:19 +0200 Subject: [PATCH 4/5] proper padding for Tags action --- apps/systemtags/css/systemtagsfilelist.css | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/systemtags/css/systemtagsfilelist.css b/apps/systemtags/css/systemtagsfilelist.css index 32cce759ec23e..2da8cd4001276 100644 --- a/apps/systemtags/css/systemtagsfilelist.css +++ b/apps/systemtags/css/systemtagsfilelist.css @@ -30,6 +30,7 @@ #app-sidebar .mainFileInfoView .tag-label { cursor: pointer; + padding: 13px; } #app-sidebar .mainFileInfoView .icon-tag { From 923890ea74dfa77278f03514ffd4b56dd0740f3b Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 21 Sep 2016 10:56:47 +0200 Subject: [PATCH 5/5] fix sidebar tab headers margin --- core/css/apps.css | 1 + 1 file changed, 1 insertion(+) diff --git a/core/css/apps.css b/core/css/apps.css index be5b045cc28cb..eaebefef571ce 100644 --- a/core/css/apps.css +++ b/core/css/apps.css @@ -600,6 +600,7 @@ em { /* generic tab styles */ .tabHeaders { + display: inline-block; margin: 15px; } .tabHeaders .tabHeader {