1 // ========================================================================== 2 // Project: The M-Project - Mobile HTML5 Application Framework 3 // Copyright: (c) 2010 M-Way Solutions GmbH. All rights reserved. 4 // (c) 2011 panacoda GmbH. All rights reserved. 5 // Creator: Sebastian 6 // Date: 02.11.2010 7 // License: Dual licensed under the MIT or GPL Version 2 licenses. 8 // http://github.com/mwaylabs/The-M-Project/blob/master/MIT-LICENSE 9 // http://github.com/mwaylabs/The-M-Project/blob/master/GPL-LICENSE 10 // ========================================================================== 11 12 /** 13 * @class 14 * 15 * The defines the prototype of a scrollable content view. It should be used as a wrapper 16 * for any content that isn't part of a header or footer toolbar / tabbar. 17 * 18 * @extends M.View 19 */ 20 M.ScrollView = M.View.extend( 21 /** @scope M.ScrollView.prototype */ { 22 23 /** 24 * The type of this object. 25 * 26 * @type String 27 */ 28 type: 'M.ScrollView', 29 30 /** 31 * Renders in three steps: 32 * 1. Rendering Opening div tag with corresponding data-role 33 * 2. Triggering render process of child views 34 * 3. Rendering closing tag 35 * 36 * @private 37 * @returns {String} The scroll view's html representation. 38 */ 39 render: function() { 40 this.html += '<div id="' + this.id + '" data-role="content"' + this.style() + '>'; 41 42 this.renderChildViews(); 43 44 this.html += '</div>'; 45 46 return this.html; 47 }, 48 49 /** 50 * Applies some style-attributes to the scroll view. 51 * 52 * @private 53 * @returns {String} The button's styling as html representation. 54 */ 55 style: function() { 56 var html = ''; 57 if(this.cssClass) { 58 html += ' class="' + this.cssClass + '"'; 59 } 60 return html; 61 } 62 63 });