diff options
Diffstat (limited to 'apps/files/js/detailtabview.js')
-rw-r--r-- | apps/files/js/detailtabview.js | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/apps/files/js/detailtabview.js b/apps/files/js/detailtabview.js index f630099111d..767ece2297c 100644 --- a/apps/files/js/detailtabview.js +++ b/apps/files/js/detailtabview.js @@ -17,8 +17,8 @@ * Base class for tab views to display file information. * */ - var DetailTabView = function() { - this.initialize(); + var DetailTabView = function(id) { + this.initialize(id); }; /** @@ -51,9 +51,16 @@ /** * Initialize the details view + * + * @param {string} id tab id */ - initialize: function() { + initialize: function(id) { + if (!id) { + throw 'Argument "id" is required'; + } + this._id = id; this.$el = $('<div class="detailTabView"></div>'); + this.$el.attr('id', id); }, /** @@ -66,6 +73,15 @@ }, /** + * Returns the tab element id + * + * @return {string} tab id + */ + getId: function() { + return this._id; + }, + + /** * Returns the tab label * * @return {String} label @@ -81,6 +97,9 @@ */ render: function() { // to be implemented in subclass + // FIXME: code is only for testing + this.$el.empty(); + this.$el.append('<div>Hello ' + this._id + '</div>'); }, /** |