Roo/bootstrap/Popover.js
authorAlan Knowles <alan@roojs.com>
Thu, 11 Feb 2021 04:08:40 +0000 (12:08 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 11 Feb 2021 04:08:40 +0000 (12:08 +0800)
Roo/bootstrap/Popover.js

index 9f61e21..de5feff 100644 (file)
@@ -366,7 +366,7 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             
             case 'left':
                 var exact = this.el.getAlignToXY(this.alignEl, 'tr-tl', [-10,0]);
-                var offset = this.el.getAlignToXY(this.alignEl, 'tl-tr?',[-10,0]);
+                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);
@@ -384,24 +384,33 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
                 if (!try_move || exact.equals(offset) || exact[1] == offset[1] ) {
                     //normal display... or moved up/down.
                     this.setXY(offset);
-                    var xy = this.alignEl.getAnchorXY('tl', false);
+                    var xy = this.alignEl.getAnchorXY('b', false);
                     xy[0]+=2;xy[1]+=5; // << fix me
                     this.arrowEl.setXY(xy);
                     return true;
                 }
-                return this.updatePosition('right', false);
+                // fall through
+                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]);
+                if (!try_move || exact.equals(offset) || exact[1] == offset[1] ) {
+                    //normal display... or moved up/down.
+                    this.setXY(offset);
+                    var xy = this.alignEl.getAnchorXY('t', false);
+                    xy[0]+=2;xy[1]+=5; // << fix me
+                    this.arrowEl.setXY(xy);
+                    return true;
+                }
+                // fall through
+                return this.updatePosition('top', false);
                 
             
         }
         
         
-        
-        // work out the pointy position.
-        var p1 = this.alignment[0].split('-').pop().replace('?','');
-        var xy = this.alignEl.getAnchorXY(p1, false);
-        xy[0]+=2;xy[1]+=5;
-        this.arrowEl.setXY(xy);
-        return true;
+        return false;
     },
     
     hide : function()