Roo.bootstrap.Tooltip = function(config){
Roo.bootstrap.Tooltip.superclass.constructor.call(this, config);
+
+ this.alignment = Roo.bootstrap.Tooltip.alignment;
+
+ if(typeof(config) != 'undefined' && typeof(config.alignment) != 'undefined'){
+ this.alignment = config.alignment;
+ }
+
};
Roo.apply(Roo.bootstrap.Tooltip, {
placement : 'bottom',
+ alignment : false,
+
getAutoCreate : function(){
var cfg = {
}, delay);
},
- show : function ()
+ show : function (msg)
{
if (!this.el) {
this.render(document.body);
// set content.
//Roo.log([this.bindEl, this.bindEl.attr('tooltip')]);
- var tip = this.bindEl.attr('tooltip') || this.bindEl.select("[tooltip]").first().attr('tooltip');
+ var tip = msg || this.bindEl.attr('tooltip') || this.bindEl.select("[tooltip]").first().attr('tooltip');
this.el.select('.tooltip-inner',true).first().dom.innerHTML = tip;
// fixme..
}
- var align = this.alignment ? this.alignment[placement] : Roo.bootstrap.Tooltip.alignment[placement];
+ var align = this.alignment[placement];
var xy = this.el.getAlignToXY(this.bindEl, align[0], align[1]);
placement = 'top';
}
+ align = this.alignment[placement];
}
this.el.alignTo(this.bindEl, align[0],align[1]);