summaryrefslogtreecommitdiffstats
path: root/apps/files/js/detailfileinfoview.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-08-12 17:30:20 +0200
committerVincent Petry <pvince81@owncloud.com>2015-08-12 17:30:20 +0200
commitc964eff17b1a7feeab794f6035a7beff8143ac85 (patch)
tree0434d46c76dc42c0b8ba9323d7aff600fa320428 /apps/files/js/detailfileinfoview.js
parent997577cf7a5edc076c4039a7fc7c1c08c050a996 (diff)
downloadnextcloud-server-c964eff17b1a7feeab794f6035a7beff8143ac85.tar.gz
nextcloud-server-c964eff17b1a7feeab794f6035a7beff8143ac85.zip
Make file actions work from sidebar
The favorite icon in the sidebar now triggers the file action and also updates itself according to the model's state when triggered from the file row. The thumbnail triggers the default action. Currently only one FileInfoModel is used for the selection and state synchronization between views. FileList reload now auto-closes the sidebar.
Diffstat (limited to 'apps/files/js/detailfileinfoview.js')
-rw-r--r--apps/files/js/detailfileinfoview.js52
1 files changed, 6 insertions, 46 deletions
diff --git a/apps/files/js/detailfileinfoview.js b/apps/files/js/detailfileinfoview.js
index 9a88b5e2d8a..43595001212 100644
--- a/apps/files/js/detailfileinfoview.js
+++ b/apps/files/js/detailfileinfoview.js
@@ -16,35 +16,13 @@
* Displays a block of details about the file info.
*
*/
- var DetailFileInfoView = function() {
- this.initialize();
- };
- /**
- * @memberof OCA.Files
- */
- DetailFileInfoView.prototype = {
- /**
- * jQuery element
- */
- $el: null,
+ var DetailFileInfoView = OC.Backbone.View.extend({
+ tagName: 'div',
+ className: 'detailFileInfoView',
_template: null,
/**
- * Currently displayed file info
- *
- * @type OCA.Files.FileInfo
- */
- _fileInfo: null,
-
- /**
- * Initialize the details view
- */
- initialize: function() {
- this.$el = $('<div class="detailFileInfoView"></div>');
- },
-
- /**
* returns the jQuery object for HTML output
*
* @returns {jQuery}
@@ -54,30 +32,12 @@
},
/**
- * Destroy / uninitialize this instance.
- */
- destroy: function() {
- if (this.$el) {
- this.$el.remove();
- }
- },
-
- /**
- * Renders this details view
- *
- * @abstract
- */
- render: function() {
- // to be implemented in subclass
- },
-
- /**
* Sets the file info to be displayed in the view
*
* @param {OCA.Files.FileInfo} fileInfo file info to set
*/
setFileInfo: function(fileInfo) {
- this._fileInfo = fileInfo;
+ this.model = fileInfo;
this.render();
},
@@ -87,9 +47,9 @@
* @return {OCA.Files.FileInfo} file info
*/
getFileInfo: function() {
- return this._fileInfo;
+ return this.model;
}
- };
+ });
OCA.Files.DetailFileInfoView = DetailFileInfoView;
})();