Roo/bootstrap/Menu.js
[roojs1] / roojs-bootstrap-debug.js
index 7c4b864..bba4256 100644 (file)
@@ -2246,12 +2246,14 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
         this.hidden = false;
         this.triggerEl.addClass('open');
         
+        // reassign x when hitting right
         if(this.el.getWidth() + xy[0] >= Roo.lib.Dom.getViewWidth()){
             xy[0] = xy[0] - this.el.getWidth() + this.triggerEl.getWidth();
         }
         
+        // reassign y when hitting bottom
         if(this.el.getHeight() + xy[1] >= Roo.lib.Dom.getViewHeight()){
-            xy[1] = this.el.getAlignToXY(this.triggerEl, '?')[1];
+            xy[1] = xy[1] - this.el.getHeight() - this.triggerEl.getHeight();
         }
         
         if(this.el.getStyle('top') != 'auto' && this.el.getStyle('top').slice(-1) != "%"){