X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/Anchor.html diff --git a/docs/source/Anchor.html b/docs/source/Anchor.html index 0c94be07..b4f1f879 100644 --- a/docs/source/Anchor.html +++ b/docs/source/Anchor.html @@ -120,9 +120,7 @@ anchor: '-50 75%' /** * @cfg {String} defaultAnchor - * - * default anchor for all child container items applied if no anchor or specific width is set on the child item. Defaults to '100%'. - * + * Default anchor for all child <b>container</b> items applied if no anchor or specific width is set on the child item. Defaults to '100%'. */ defaultAnchor: '100%', @@ -142,8 +140,8 @@ anchor: '-50 75%' components = me.getVisibleItems(owner), len = components.length, boxes = [], - box, newTargetSize, anchorWidth, anchorHeight, component, anchorSpec, calcWidth, calcHeight, - anchorsArray, anchor, i, el, cleaner; + box, newTargetSize, component, anchorSpec, calcWidth, calcHeight, + i, el, cleaner; if (ownerWidth < 20 && ownerHeight < 20) { return; @@ -159,21 +157,6 @@ anchor: '-50 75%' }); } - // find the container anchoring size - if (owner.anchorSize) { - if (typeof owner.anchorSize == 'number') { - anchorWidth = owner.anchorSize; - } - else { - anchorWidth = owner.anchorSize.width; - anchorHeight = owner.anchorSize.height; - } - } - else { - anchorWidth = owner.initialConfig.width; - anchorHeight = owner.initialConfig.height; - } - // Work around WebKit RightMargin bug. We're going to inline-block all the children only ONCE and remove it when we're done if (!Ext.supports.RightMargin) { cleaner = Ext.core.Element.getRightMarginFixCleaner(target); @@ -183,24 +166,19 @@ anchor: '-50 75%' for (i = 0; i < len; i++) { component = components[i]; el = component.el; - anchor = component.anchor; - if (!component.anchor && component.items && !Ext.isNumber(component.width) && !(Ext.isIE6 && Ext.isStrict)) { - component.anchor = anchor = me.defaultAnchor; - } - - if (anchor) { - anchorSpec = component.anchorSpec; - // cache all anchor values - if (!anchorSpec) { - anchorsArray = anchor.split(' '); - component.anchorSpec = anchorSpec = { - right: me.parseAnchor(anchorsArray[0], component.initialConfig.width, anchorWidth), - bottom: me.parseAnchor(anchorsArray[1], component.initialConfig.height, anchorHeight) - }; + anchorSpec = component.anchorSpec; + if (anchorSpec) { + if (anchorSpec.right) { + calcWidth = me.adjustWidthAnchor(anchorSpec.right(ownerWidth) - el.getMargin('lr'), component); + } else { + calcWidth = undefined; + } + if (anchorSpec.bottom) { + calcHeight = me.adjustHeightAnchor(anchorSpec.bottom(ownerHeight) - el.getMargin('tb'), component); + } else { + calcHeight = undefined; } - calcWidth = anchorSpec.right ? me.adjustWidthAnchor(anchorSpec.right(ownerWidth) - el.getMargin('lr'), component) : undefined; - calcHeight = anchorSpec.bottom ? me.adjustHeightAnchor(anchorSpec.bottom(ownerHeight) - el.getMargin('tb'), component) : undefined; boxes.push({ component: component, @@ -277,6 +255,60 @@ anchor: '-50 75%' // private adjustHeightAnchor: function(value, comp) { return value; + }, + + configureItem: function(item) { + var me = this, + owner = me.owner, + anchor= item.anchor, + anchorsArray, + anchorSpec, + anchorWidth, + anchorHeight; + + if (!item.anchor && item.items && !Ext.isNumber(item.width) && !(Ext.isIE6 && Ext.isStrict)) { + item.anchor = anchor = me.defaultAnchor; + } + + // find the container anchoring size + if (owner.anchorSize) { + if (typeof owner.anchorSize == 'number') { + anchorWidth = owner.anchorSize; + } + else { + anchorWidth = owner.anchorSize.width; + anchorHeight = owner.anchorSize.height; + } + } + else { + anchorWidth = owner.initialConfig.width; + anchorHeight = owner.initialConfig.height; + } + + if (anchor) { + // cache all anchor values + anchorsArray = anchor.split(' '); + item.anchorSpec = anchorSpec = { + right: me.parseAnchor(anchorsArray[0], item.initialConfig.width, anchorWidth), + bottom: me.parseAnchor(anchorsArray[1], item.initialConfig.height, anchorHeight) + }; + + if (anchorSpec.right) { + item.layoutManagedWidth = 1; + } else { + item.layoutManagedWidth = 2; + } + + if (anchorSpec.bottom) { + item.layoutManagedHeight = 1; + } else { + item.layoutManagedHeight = 2; + } + } else { + item.layoutManagedWidth = 2; + item.layoutManagedHeight = 2; + } + this.callParent(arguments); } });