1 // ==========================================================================
  2 // Project:   The M-Project - Mobile HTML5 Application Framework
  3 // Copyright: (c) 2010 M-Way Solutions GmbH. All rights reserved.
  4 // Creator:   Dominik
  5 // Date:      01.12.2010
  6 // License:   Dual licensed under the MIT or GPL Version 2 licenses.
  7 //            http://github.com/mwaylabs/The-M-Project/blob/master/MIT-LICENSE
  8 //            http://github.com/mwaylabs/The-M-Project/blob/master/GPL-LICENSE
  9 // ==========================================================================
 10 
 11 /**
 12  * @class
 13  *
 14  * A container view renders a simple div container that can be used to display
 15  * any html valid content, e.g. by third party frameworks.
 16  *
 17  * @extends M.View
 18  */
 19 M.ContainerView = M.View.extend(
 20 /** @scope M.ContainerView.prototype */ {
 21 
 22     /**
 23      * The type of this object.
 24      *
 25      * @type String
 26      */
 27     type: 'M.ContainerView',
 28 
 29     /**
 30      * Renders a simple div container and applies css classes if specified.
 31      *
 32      * @private
 33      * @returns {String} The container view's html representation.
 34      */
 35     render: function() {
 36         this.html += '<div id="' + this.id + '"' + this.style() + '></div>';      
 37         return this.html;
 38     },
 39 
 40     /**
 41      * Applies some style-attributes to the container view.
 42      *
 43      * @private
 44      * @returns {String} The container's styling as html representation.
 45      */
 46     style: function() {
 47         var html = '';
 48         if(this.cssClass) {
 49             html += ' class="' + this.cssClass + '"';
 50         }
 51         return html;
 52     }
 53 
 54 });