X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fbootstrap%2FPopover.js;h=031926d4fc85ea0824233a862368bfbdaa1895f9;hb=7700b2c5de4e083e5c3b3d46cc4e2ff2ab68aab1;hp=e001c1881020b9cd388052f0b3ae3886a591c75b;hpb=e2f3f95937a0262710ebbdf11f3f122a1d6fdfbd;p=roojs1 diff --git a/Roo/bootstrap/Popover.js b/Roo/bootstrap/Popover.js index e001c18810..031926d4fc 100644 --- a/Roo/bootstrap/Popover.js +++ b/Roo/bootstrap/Popover.js @@ -276,12 +276,12 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component, { if (this.parent() && (this.over == 'parent' || (this.over === false))) { on_el = this.parent().el; } else if (this.over) { - Roo.get(this.over); + on_el = Roo.get(this.over); } } - this.alignEl = on_el; + this.alignEl = Roo.get( on_el ); if (!this.el) { this.render(document.body); @@ -444,15 +444,18 @@ Roo.apply(Roo.bootstrap.Popover, { clickHander : false, + onMouseDown : function(e) { - if (!e.getTarget(".roo-popover")) { + if (this.popups.length && !e.getTarget(".roo-popover")) { + /// what is nothing is showing.. this.hideAll(); } }, + popups : [], register : function(popup) @@ -461,14 +464,22 @@ Roo.apply(Roo.bootstrap.Popover, { Roo.bootstrap.Popover.clickHandler = Roo.get(document).on("mousedown", Roo.bootstrap.Popover.onMouseDown, Roo.bootstrap.Popover); } // hide other popups. - this.hideAll(); - this.popups.push(popup); + popup.on('show', Roo.bootstrap.Popover.onShow, popup); + popup.on('hide', Roo.bootstrap.Popover.onHide, popup); + this.hideAll(); //<< why? + //this.popups.push(popup); }, hideAll : function() { this.popups.forEach(function(p) { p.hide(); }); - } + }, + onShow : function() { + Roo.bootstrap.Popover.popups.push(this); + }, + onHide : function() { + Roo.bootstrap.Popover.popups.remove(this); + } }); \ No newline at end of file