return;
}
- fileList.registerDetailView(new OCA.SystemTags.SystemTagsInfoView());
+ var systemTagsInfoView = new OCA.SystemTags.SystemTagsInfoView();
+ fileList.registerDetailView(systemTagsInfoView);
+
+ _.each(fileList.getRegisteredDetailViews(), function(detailView) {
+ if (detailView instanceof OCA.Files.MainFileInfoDetailView) {
+ systemTagsInfoView.setMainFileInfoView(detailView);
+
+ return;
+ }
+ });
}
};
this._toggleHandle = $('<span>').addClass('tag-label').text(t('systemtags', 'Tags'));
this._toggleHandle.prepend($('<span>').addClass('icon icon-tag'));
+
+ this._toggleHandle.on('click', function () {
+ self.$el.toggleClass('hidden');
+ if (!self.$el.hasClass('hidden')) {
+ self.$el.find('.systemTagsInputField').select2('open');
+ }
+ });
},
/**
this.selectedTagsCollection.remove(tagId);
},
+ setMainFileInfoView: function(mainFileInfoView) {
+ this.listenTo(mainFileInfoView, 'pre-render', function() {
+ this._toggleHandle.detach();
+ });
+ this.listenTo(mainFileInfoView, 'post-render', function() {
+ mainFileInfoView.$el.find('.file-details').append(this._toggleHandle);
+ });
+ },
+
setFileInfo: function(fileInfo) {
var self = this;
if (!this._rendered) {
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 () {
- self.$el.toggleClass('hidden');
- if (!self.$el.hasClass('hidden')) {
- self.$el.find('.systemTagsInputField').select2('open');
- }
- });
},
remove: function() {