summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/systemtags/css/systemtagsfilelist.css10
-rw-r--r--apps/systemtags/img/tag.svg2
-rw-r--r--apps/systemtags/js/systemtagsinfoview.js28
-rw-r--r--core/css/icons.css4
-rw-r--r--core/img/actions/tag.svg5
5 files changed, 46 insertions, 3 deletions
diff --git a/apps/systemtags/css/systemtagsfilelist.css b/apps/systemtags/css/systemtagsfilelist.css
index e8fb665e26b..2da8cd40012 100644
--- a/apps/systemtags/css/systemtagsfilelist.css
+++ b/apps/systemtags/css/systemtagsfilelist.css
@@ -27,3 +27,13 @@
.nav-icon-systemtagsfilter {
background-image: url('../img/tag.svg');
}
+
+#app-sidebar .mainFileInfoView .tag-label {
+ cursor: pointer;
+ padding: 13px;
+}
+
+#app-sidebar .mainFileInfoView .icon-tag {
+ opacity: .5;
+ vertical-align: middle;
+}
diff --git a/apps/systemtags/img/tag.svg b/apps/systemtags/img/tag.svg
index 293a7f5be9c..d95ddbcc5a0 100644
--- a/apps/systemtags/img/tag.svg
+++ b/apps/systemtags/img/tag.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.0">
+<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.0" viewBox="0 0 16 16">
<rect style="color:#000000" fill-opacity="0" height="97.986" width="163.31" y="-32.993" x="-62.897"/>
<path d="m6.1861 0.96121-4.807 0.01316c-0.27161 0-0.34656 0.20987-0.34703 0.34604l-0.015132 4.8017 8.7232 8.7222c0.19688 0.19829 0.51234 0.19697 0.7092 0l4.4569-4.4569c0.19672-0.19688 0.19895-0.51327 0.002-0.71024l-0.0011 0.00876-8.3668-8.3668-0.3541-0.35417zm-2.1669 1.8522a1.1438 1.1438 0 0 1 1.144 1.144 1.1438 1.1438 0 0 1 -1.144 1.144 1.1438 1.1438 0 0 1 -1.144 -1.144 1.1438 1.1438 0 0 1 1.144 -1.144z"/>
</svg>
diff --git a/apps/systemtags/js/systemtagsinfoview.js b/apps/systemtags/js/systemtagsinfoview.js
index a7320a3956f..ce41bc504e2 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 = $('<span>').addClass('tag-label').text(t('systemtags', 'Tags'));
+ this._toggleHandle.prepend($('<span>').addClass('icon icon-tag'));
},
/**
@@ -118,11 +123,19 @@
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');
+ }
}
});
}
+
this.$el.addClass('hidden');
},
@@ -130,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 1e8e1bff1c3..3b12f9ea2e6 100644
--- a/core/css/icons.css
+++ b/core/css/icons.css
@@ -291,6 +291,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 00000000000..d95ddbcc5a0
--- /dev/null
+++ b/core/img/actions/tag.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.0" viewBox="0 0 16 16">
+ <rect style="color:#000000" fill-opacity="0" height="97.986" width="163.31" y="-32.993" x="-62.897"/>
+ <path d="m6.1861 0.96121-4.807 0.01316c-0.27161 0-0.34656 0.20987-0.34703 0.34604l-0.015132 4.8017 8.7232 8.7222c0.19688 0.19829 0.51234 0.19697 0.7092 0l4.4569-4.4569c0.19672-0.19688 0.19895-0.51327 0.002-0.71024l-0.0011 0.00876-8.3668-8.3668-0.3541-0.35417zm-2.1669 1.8522a1.1438 1.1438 0 0 1 1.144 1.144 1.1438 1.1438 0 0 1 -1.144 1.144 1.1438 1.1438 0 0 1 -1.144 -1.144 1.1438 1.1438 0 0 1 1.144 -1.144z"/>
+</svg>