}
+ this.alignEl = on_el;
+
if (!this.el) {
this.render(document.body);
}
- this.el.removeClass([
- 'fade','top','bottom', 'left', 'right','in',
- 'bs-popover-top','bs-popover-bottom', 'bs-popover-left', 'bs-popover-right'
- ]);
+
if (this.title === false) {
this.headerEl.hide();
this.el.show();
this.el.dom.style.display = 'block';
-
- this.el.addClass(placement + ' roo-popover-' + placement);
-
- if (on_el) {
- this.updatePosition();
+
+ if (this.alignEl) {
+ this.updatePosition(this.placement, true);
} else {
// this is usually just done by the builder = to show the popoup in the middle of the scren.
},
/**
* fire this manually after loading a grid in the table for example
- * @param {string} (left|right|top|bottom) where to try and put it
+ * @param {string} (left|right|top|bottom) where to try and put it (use false to use the last one)
* @param {Boolean} try and move it if we cant get right position.
*/
updatePosition : function(placement, try_move)
{
+ placement = placement === false ? this.placement : placement;
+
this.el.removeClass([
'fade','top','bottom', 'left', 'right','in',
'bs-popover-top','bs-popover-bottom', 'bs-popover-left', 'bs-popover-right'
var offset = this.el.getAlignToXY(this.alignEl, 'tl-tr?',[10,0]);
if (!try_move || exact.equals(offset) || exact[0] == offset[0] ) {
//normal display... or moved up/down.
- this.setXY(offset);
+ this.el.setXY(offset);
var xy = this.alignEl.getAnchorXY('tr', false);
xy[0]+=2;xy[1]+=5;
this.arrowEl.setXY(xy);
var offset = this.el.getAlignToXY(this.alignEl, 'tr-tl?',[-10,0]);
if (!try_move || exact.equals(offset) || exact[0] == offset[0] ) {
//normal display... or moved up/down.
- this.setXY(offset);
+ this.el.setXY(offset);
var xy = this.alignEl.getAnchorXY('tl', false);
xy[0]+=2;xy[1]+=5; // << fix me
this.arrowEl.setXY(xy);
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.setXY(offset);
+ this.el.setXY(offset);
var xy = this.alignEl.getAnchorXY('b', false);
xy[0]+=2;xy[1]+=5; // << fix me
this.arrowEl.setXY(xy);
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.setXY(offset);
+ this.el.setXY(offset);
var xy = this.alignEl.getAnchorXY('t', false);
xy[0]+=2;xy[1]+=5; // << fix me
this.arrowEl.setXY(xy);