diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-08-10 13:14:15 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-08-10 13:14:15 +0200 |
commit | 15e16d335db5771778477e944d4e63ac807382b9 (patch) | |
tree | 597e7ea2f7adf12f257ccc78c04f90c06958aba3 /apps/files/js/detailfileinfoview.js | |
parent | 214729a5524e2c406415985717c174bedc810954 (diff) | |
parent | 038d29b8def77ad906a722f72a1501b369f9c1ee (diff) | |
download | nextcloud-server-15e16d335db5771778477e944d4e63ac807382b9.tar.gz nextcloud-server-15e16d335db5771778477e944d4e63ac807382b9.zip |
Merge pull request #17656 from owncloud/files-rightsidebar
Basic work for right sidebar
Diffstat (limited to 'apps/files/js/detailfileinfoview.js')
-rw-r--r-- | apps/files/js/detailfileinfoview.js | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/apps/files/js/detailfileinfoview.js b/apps/files/js/detailfileinfoview.js new file mode 100644 index 00000000000..9a88b5e2d8a --- /dev/null +++ b/apps/files/js/detailfileinfoview.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2015 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +(function() { + /** + * @class OCA.Files.DetailFileInfoView + * @classdesc + * + * Displays a block of details about the file info. + * + */ + var DetailFileInfoView = function() { + this.initialize(); + }; + /** + * @memberof OCA.Files + */ + DetailFileInfoView.prototype = { + /** + * jQuery element + */ + $el: null, + + _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} + */ + get$: function() { + return this.$el; + }, + + /** + * 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.render(); + }, + + /** + * Returns the file info. + * + * @return {OCA.Files.FileInfo} file info + */ + getFileInfo: function() { + return this._fileInfo; + } + }; + + OCA.Files.DetailFileInfoView = DetailFileInfoView; +})(); + |