TipMgr = new Ext.util.Observable(); Ext.apply(TipMgr,{ currentTip: null, hidePrevious: function(){ if(this.currentTip) this.currentTip.hide(); } }); function help(thisTarget,url,title){ TipMgr.hidePrevious(); if (!thisTarget.hasHelpTip) { tip = new Ext.ToolTip({ target: thisTarget, anchor: 'left', defaultAnchor:'left', maxWidth:600, autoShow: false, autoLoad:{ url:'http://panel.exone.pl/help/get', params:{ crossUrl: 'http://test.exone.pl/'+url }, callback:function(){ var anch = tip.getEl().select('.x-tip-anchor').item(0); if( anch.hasClass('x-tip-anchor-bottom') ){ tip.getEl().setY( anch.getY() - tip.getEl().getHeight() ); anch.setY( tip.getEl().getY() + tip.getEl().getHeight()-1 ); } }, scope:this }, autoWidth: true, autoHeight: true, title:title, autoHide: false, closable: true, draggable: true }); tip.show(); tip.on('beforeshow',function(){ TipMgr.hidePrevious(); TipMgr.currentTip = this; },tip); thisTarget.hasHelpTip = true; thisTarget.helpTip = tip; TipMgr.currentTip = tip; }else{ thisTarget.helpTip.show(); } }