Roo/bootstrap/Popover.js
authorAlan Knowles <alan@roojs.com>
Wed, 27 Jan 2021 09:28:33 +0000 (17:28 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 27 Jan 2021 09:28:33 +0000 (17:28 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/Popover.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 0135db5..7728003 100644 (file)
@@ -11,7 +11,7 @@
  * Bootstrap Popover class
  * @cfg {String} html contents of the popover   (or false to use children..)
  * @cfg {String} title of popover (or false to hide)
- * @cfg {String|function} (right|top) placement how it is placed
+ * @cfg {String|function} (right|top|bottom|left|auto) placement how it is placed
  * @cfg {String} trigger click || hover (or false to trigger manually)
  * @cfg {String} over what (parent or false to trigger manually.)
  * @cfg {Number} delay - delay before showing
@@ -245,7 +245,6 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
         //this.el.setXY([0,0]);
         this.el.show();
         this.el.dom.style.display='block';
-        this.el.addClass(placement);
         
         //this.el.appendTo(on_el);
         
@@ -256,7 +255,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             // fixme..
         }
         var align = Roo.bootstrap.Popover.alignment[placement];
-        
+        this.el.addClass(align[2]);
+
 //        Roo.log(align);
         this.el.alignTo(on_el, align[0],align[1]);
         //var arrow = this.el.select('.arrow',true).first();
index 8b5fffa..4b764a7 100644 (file)
@@ -19602,7 +19602,7 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
  * Bootstrap Popover class
  * @cfg {String} html contents of the popover   (or false to use children..)
  * @cfg {String} title of popover (or false to hide)
- * @cfg {String|function} (right|top) placement how it is placed
+ * @cfg {String|function} (right|top|bottom|left|auto) placement how it is placed
  * @cfg {String} trigger click || hover (or false to trigger manually)
  * @cfg {String} over what (parent or false to trigger manually.)
  * @cfg {Number} delay - delay before showing
@@ -19836,7 +19836,6 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
         //this.el.setXY([0,0]);
         this.el.show();
         this.el.dom.style.display='block';
-        this.el.addClass(placement);
         
         //this.el.appendTo(on_el);
         
@@ -19847,7 +19846,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             // fixme..
         }
         var align = Roo.bootstrap.Popover.alignment[placement];
-        
+        this.el.addClass(align[2]);
+
 //        Roo.log(align);
         this.el.alignTo(on_el, align[0],align[1]);
         //var arrow = this.el.select('.arrow',true).first();
index 7882cba..49079c0 100644 (file)
@@ -819,8 +819,8 @@ var E=C=='hover'?'mouseleave':'focusout';A.on(D,this.enter,this);A.on(E,this.lea
 if(!this.delay||!this.delay.show){this.show();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='in'){_t.show();}},this.delay.show)},leave:function(){clearTimeout(this.timeout);this.hoverState='out';if(!this.delay||!this.delay.hide){this.hide();
 return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='out'){_t.hide();}},this.delay.hide)},show:function(A){if(!A){A=(this.over=='parent')?this.parent().el:Roo.get(this.over);}if(!this.el){this.render();}this.el.select('.popover-title',true).first().dom.innerHtml=this.title;
 if(this.html!==false){this.el.select('.popover-content',true).first().dom.innerHtml=this.html;}this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']);if(!this.title.length){this.el.select('.popover-title',true).hide();
-}var B=typeof this.placement=='function'?this.placement.call(this,this.el,A):this.placement;var C=/\s?auto?\s?/i;var D=C.test(B);if(D){B=B.replace(C,'')||'top';}this.el.show();this.el.dom.style.display='block';this.el.addClass(B);var p=this.getPosition();
-var E=this.el.getBox();if(D){}var F=Roo.bootstrap.Popover.alignment[B];this.el.alignTo(A,F[0],F[1]);this.el.addClass('in');if(this.el.hasClass('fade')){}this.hoverState='in';this.fireEvent('show',this);},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');
+}var B=typeof this.placement=='function'?this.placement.call(this,this.el,A):this.placement;var C=/\s?auto?\s?/i;var D=C.test(B);if(D){B=B.replace(C,'')||'top';}this.el.show();this.el.dom.style.display='block';var p=this.getPosition();var E=this.el.getBox();
+if(D){}var F=Roo.bootstrap.Popover.alignment[B];this.el.addClass(F[2]);this.el.alignTo(A,F[0],F[1]);this.el.addClass('in');if(this.el.hasClass('fade')){}this.hoverState='in';this.fireEvent('show',this);},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');
 this.el.hide();this.hoverState=null;this.fireEvent('hide',this);}});Roo.bootstrap.Popover.alignment={'left':['r-l',[-10,0],'right bs-popover-right'],'right':['l-r',[10,0],'left bs-popover-left'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
 ;
 // Roo/bootstrap/Progress.js