📄 tip.js
字号:
Ext.Tip = Ext.extend(Ext.Panel, {
frame:true,
hidden:true,
baseCls: 'x-tip',
floating:{shadow:true,shim:true,useDisplay:true,constrain:false},
autoHeight:true,
/**
* @cfg {Number} minWidth The minimum width of the tip in pixels (defaults to 40)
*/
minWidth : 40,
/**
* @cfg {Number} maxWidth The maximum width of the tip in pixels (defaults to 300)
*/
maxWidth : 300,
/**
* @cfg {Boolean/String} shadow True or "sides" for the default effect, "frame" for 4-way shadow, and "drop"
* for bottom-right shadow (defaults to "sides")
*/
shadow : "sides",
/**
* @cfg {String} defaultAlign The default {@link Ext.Element#alignTo) anchor position value for this tip
* relative to its element of origin (defaults to "tl-bl?")
*/
defaultAlign : "tl-bl?",
autoRender: true,
quickShowInterval : 250,
afterRender : function(){
Ext.Tip.superclass.afterRender.call(this);
if(this.closable){
this.addTool({
id: 'close',
handler: this.hide,
scope: this
});
}
},
showAt : function(xy){
Ext.Tip.superclass.show.call(this);
if(this.measureWidth !== false){
var bw = this.body.getTextWidth();
if(this.title){
bw = Math.max(bw, this.header.child('span').getTextWidth(this.title));
}
bw += this.getFrameWidth() + (this.closable ? 20 : 0);
this.setWidth(bw.constrain(this.minWidth, this.maxWidth));
}
if(this.constrainPosition){
xy = this.el.adjustForConstraints(xy);
}
this.setPagePosition(xy[0], xy[1]);
},
showBy : function(el, pos){
if(!this.rendered){
this.render(Ext.getBody());
}
this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign));
}
});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -