2
* Ext JS Library 3.0 RC2
3
* Copyright(c) 2006-2009, Ext JS, LLC.
6
* http://extjs.com/license
10
* @class Ext.layout.FitLayout
11
* @extends Ext.layout.ContainerLayout
12
* <p>This is a base class for layouts that contain <b>a single item</b> that automatically expands to fill the layout's
13
* container. This class is intended to be extended or created via the <tt>layout:'fit'</tt> {@link Ext.Container#layout}
14
* config, and should generally not need to be created directly via the new keyword.</p>
15
* <p>FitLayout does not have any direct config options (other than inherited ones). To fit a panel to a container
16
* using FitLayout, simply set layout:'fit' on the container and add a single panel to it. If the container has
17
* multiple panels, only the first one will be displayed. Example usage:</p>
19
var p = new Ext.Panel({
24
html: '<p>This is the inner panel content</p>',
30
Ext.layout.FitLayout = Ext.extend(Ext.layout.ContainerLayout, {
35
onLayout : function(ct, target){
36
Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target);
37
if(!this.container.collapsed){
38
var sz = (Ext.isIE6 && Ext.isStrict && target.dom == document.body) ? target.getViewSize() : target.getStyleSize();
39
this.setItemSize(this.activeItem || ct.items.itemAt(0), sz);
44
setItemSize : function(item, size){
45
if(item && size.height > 0){ // display none?
50
Ext.Container.LAYOUTS['fit'] = Ext.layout.FitLayout;
b'\\ No newline at end of file'