X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/src/resizer/Splitter.js diff --git a/src/resizer/Splitter.js b/src/resizer/Splitter.js index c4089c3d..366629d0 100644 --- a/src/resizer/Splitter.js +++ b/src/resizer/Splitter.js @@ -13,17 +13,17 @@ If you are unsure which license is appropriate for your use, please contact the */ /** - * @class Ext.resizer.Splitter - * @extends Ext.Component - *

This class functions between siblings of a {@link Ext.layout.container.VBox VBox} or {@link Ext.layout.container.HBox HBox} - * layout to resize both immediate siblings.

- *

By default it will set the size of both siblings. One of the siblings may be configured with - * {@link Ext.Component#maintainFlex maintainFlex}: true which will cause it not to receive a new size explicitly, but to be resized - * by the layout.

- *

A Splitter may be configured to show a centered mini-collapse tool orientated to collapse the {@link #collapseTarget}. + * This class functions between siblings of a {@link Ext.layout.container.VBox VBox} or {@link Ext.layout.container.HBox HBox} + * layout to resize both immediate siblings. + * + * By default it will set the size of both siblings. One of the siblings may be configured with + * `{@link Ext.Component#maintainFlex maintainFlex}: true` which will cause it not to receive a new size explicitly, but to be resized + * by the layout. + * + * A Splitter may be configured to show a centered mini-collapse tool orientated to collapse the {@link #collapseTarget}. * The Splitter will then call that sibling Panel's {@link Ext.panel.Panel#collapse collapse} or {@link Ext.panel.Panel#expand expand} method * to perform the appropriate operation (depending on the sibling collapse state). To create the mini-collapse tool but take care - * of collapsing yourself, configure the splitter with {@link #performCollapse} false.

+ * of collapsing yourself, configure the splitter with {@link #performCollapse} false. */ Ext.define('Ext.resizer.Splitter', { extend: 'Ext.Component', @@ -32,7 +32,10 @@ Ext.define('Ext.resizer.Splitter', { alias: 'widget.splitter', renderTpl: [ - '
 
' + '', + '
 
', + '
' ], baseCls: Ext.baseCSSPrefix + 'splitter', @@ -70,7 +73,7 @@ Ext.define('Ext.resizer.Splitter', { * that the splitter is between. */ defaultSplitMax: 1000, - + /** * @cfg {String} collapsedCls * A class to add to the splitter when it is collapsed. See {@link #collapsible}. @@ -80,7 +83,7 @@ Ext.define('Ext.resizer.Splitter', { height: 5, /** - * @cfg {Mixed} collapseTarget + * @cfg {String/Ext.panel.Panel} collapseTarget *

A string describing the relative position of the immediate sibling Panel to collapse. May be 'prev' or 'next' (Defaults to 'next')

*

Or the immediate sibling Panel to collapse.

*

The orientation of the mini-collapse tool will be inferred from this setting.

@@ -104,9 +107,8 @@ Ext.define('Ext.resizer.Splitter', { collapseDir: collapseDir, collapsible: me.collapsible || target.collapsible }); - Ext.applyIf(me.renderSelectors, { - collapseEl: '.' + Ext.baseCSSPrefix + 'collapse-el' - }); + + me.addChildEls('collapseEl'); this.callParent(arguments); @@ -160,7 +162,7 @@ Ext.define('Ext.resizer.Splitter', { getCollapseTarget: function() { var me = this; - + return me.collapseTarget.isComponent ? me.collapseTarget : me.collapseTarget == 'prev' ? me.previousSibling() : me.nextSibling(); },