1 // ========================================================================== 2 // Project: SproutCore - JavaScript Application Framework 3 // Copyright: ©2006-2010 Sprout Systems, Inc. and contributors. 4 // Portions ©2008-2011 Apple Inc. All rights reserved. 5 // License: Licensed under MIT license (see license.js) 6 // ========================================================================== 7 8 SC.BaseTheme.splitRenderDelegate = SC.RenderDelegate.create({ 9 className: 'split', 10 11 // Returns { SC.LAYOUT_VERTICAL: true/false, SC.LAYOUT_HORIZONTAL: true/false } 12 // for use in setClass. 13 _classesForDataSource: function(dataSource) { 14 var classes = {}, 15 layoutDirection = dataSource.get('layoutDirection'); 16 classes[SC.LAYOUT_VERTICAL] = layoutDirection === SC.LAYOUT_VERTICAL; 17 classes[SC.LAYOUT_HORIZONTAL] = layoutDirection === SC.LAYOUT_HORIZONTAL; 18 return classes; 19 }, 20 21 render: function(dataSource, context) { 22 context.setClass(this._classesForDataSource(dataSource)); 23 }, 24 25 update: function(dataSource, jquery) { 26 jquery.setClass(this._classesForDataSource(dataSource)); 27 } 28 }); 29