2 * Component layout for Tip/ToolTip/etc. components
3 * @class Ext.layout.component.Tip
4 * @extends Ext.layout.component.Dock
8 Ext.define('Ext.layout.component.Tip', {
10 /* Begin Definitions */
12 alias: ['layout.tip'],
14 extend: 'Ext.layout.component.Dock',
20 onLayout: function(width, height) {
30 // Position offscreen so the natural width is not affected by the viewport's right edge
31 el.setXY([-9999,-9999]);
33 // Calculate initial layout
34 this.callParent(arguments);
36 // Handle min/maxWidth for auto-width tips
37 if (!Ext.isNumber(width)) {
38 minWidth = owner.minWidth;
39 maxWidth = owner.maxWidth;
40 // IE6/7 in strict mode have a problem doing an autoWidth
41 if (Ext.isStrict && (Ext.isIE6 || Ext.isIE7)) {
42 constrainedWidth = me.doAutoWidth();
44 naturalWidth = el.getWidth();
46 if (naturalWidth < minWidth) {
47 constrainedWidth = minWidth;
49 else if (naturalWidth > maxWidth) {
50 constrainedWidth = maxWidth;
52 if (constrainedWidth) {
53 this.callParent([constrainedWidth, height]);
61 doAutoWidth: function(){
65 width = body.getTextWidth();
68 width = Math.max(width, owner.header.getWidth());
70 if (!Ext.isDefined(me.frameWidth)) {
71 me.frameWidth = owner.el.getWidth() - body.getWidth();
73 width += me.frameWidth + body.getPadding('lr');