*/
updatePosition : function(placement, try_move)
{
- placement = placement === false ? this.placement : placement;
+ // allow for calling with no parameters
+ placement = placement ? placement : this.placement;
+ try_move = typeof(try_move) == 'undefined' ? true : try_move;
this.el.removeClass([
'fade','top','bottom', 'left', 'right','in',
'bs-popover-top','bs-popover-bottom', 'bs-popover-left', 'bs-popover-right'
]);
- this.el.addClass(placement + ' roo-popover-' + placement);
+ this.el.addClass(placement + ' bs-popover-' + placement);
if (!this.alignEl ) {
return false;
return this.updatePosition('right', false);
case 'top':
- var exact = this.el.getAlignToXY(this.alignEl, 't-b', [0,-10]);
- var offset = this.el.getAlignToXY(this.alignEl, 't-b?',[0,-10]);
+ var exact = this.el.getAlignToXY(this.alignEl, 'b-t', [0,-10]);
+ var offset = this.el.getAlignToXY(this.alignEl, 'b-t?',[0,-10]);
if (!try_move || exact.equals(offset) || exact[1] == offset[1] ) {
//normal display... or moved up/down.
this.el.setXY(offset);
- var xy = this.alignEl.getAnchorXY('b', false);
- xy[0]+=2;xy[1]+=5; // << fix me
+ var xy = this.alignEl.getAnchorXY('t', false);
+ xy[1]-=10; // << fix me
this.arrowEl.setXY(xy);
return true;
}
try_move = false;
case 'bottom':
- var exact = this.el.getAlignToXY(this.alignEl, 'b-t', [0,10]);
- var offset = this.el.getAlignToXY(this.alignEl, 'b-t?',[0,10]);
+ var exact = this.el.getAlignToXY(this.alignEl, 't-b', [0,10]);
+ var offset = this.el.getAlignToXY(this.alignEl, 't-b?',[0,10]);
if (!try_move || exact.equals(offset) || exact[1] == offset[1] ) {
//normal display... or moved up/down.
this.el.setXY(offset);
- var xy = this.alignEl.getAnchorXY('t', false);
+ var xy = this.alignEl.getAnchorXY('b', false);
xy[0]+=2;xy[1]+=5; // << fix me
this.arrowEl.setXY(xy);
return true;