Roo/bootstrap/Menu.js
authorjohn <john@roojs.com>
Fri, 10 Aug 2018 04:39:53 +0000 (12:39 +0800)
committerjohn <john@roojs.com>
Fri, 10 Aug 2018 04:39:53 +0000 (12:39 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

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

index 15b957e..32786bb 100644 (file)
@@ -260,7 +260,7 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
         
         this.triggerEl.addClass('open');
         
-        this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign), parentMenu, false);
+        this.showAt(this.el.getAlignToXY(el, '?'), parentMenu, false);
     },
      /**
      * Displays this menu at a specific xy position
index 67831e7..0bfd8f3 100644 (file)
@@ -2227,7 +2227,7 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
         
         this.triggerEl.addClass('open');
         
-        this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign), parentMenu, false);
+        this.showAt(this.el.getAlignToXY(el, '?'), parentMenu, false);
     },
      /**
      * Displays this menu at a specific xy position
index 83930c0..af3600c 100644 (file)
@@ -86,7 +86,7 @@ this.triggerEl.on(Roo.isTouch?'touchstart':'mouseup',this.onTriggerPress,this);t
 this.el.on("mouseout",this.onMouseOut,this);},findTargetItem:function(e){var t=e.getTarget(".dropdown-menu-item",this.el,true);if(!t){return false;}if(t&&t.id){return this.menuitems.get(t.id);}return false;},onTouch:function(e){Roo.log("menu.onTouch");this.onClick(e);
 },onClick:function(e){Roo.log("menu.onClick");var t=this.findTargetItem(e);if(!t||t.isContainer){return;}Roo.log(e);Roo.log('pass click event');t.onClick(e);this.fireEvent("click",this,t,e);var A=this;if(!t.href.length||t.href=='#'){(function(){A.hide();}
 ).defer(100);}},onMouseOver:function(e){var t=this.findTargetItem(e);this.fireEvent("mouseover",this,e,t);},isVisible:function(){return !this.hidden;},onMouseOut:function(e){var t=this.findTargetItem(e);this.fireEvent("mouseout",this,e,t);},show:function(el,A,B){this.parentMenu=B;
-if(!this.el){this.render();}this.fireEvent("beforeshow",this);this.triggerEl.addClass('open');this.showAt(this.el.getAlignToXY(el,A||this.defaultAlign),B,false);},showAt:function(xy,A,_e){this.parentMenu=A;if(!this.el){this.render();}if(_e!==false){this.fireEvent("beforeshow",this);
+if(!this.el){this.render();}this.fireEvent("beforeshow",this);this.triggerEl.addClass('open');this.showAt(this.el.getAlignToXY(el,'?'),B,false);},showAt:function(xy,A,_e){this.parentMenu=A;if(!this.el){this.render();}if(_e!==false){this.fireEvent("beforeshow",this);
 }this.hideMenuItems();this.hidden=false;this.triggerEl.addClass('open');if(this.el.getWidth()+xy[0]>=Roo.lib.Dom.getViewWidth()){xy[0]=xy[0]-(Roo.lib.Dom.getViewWidth()-this.triggerEl.getBox().right);}if(this.el.getStyle('top')!='auto'&&this.el.getStyle('top').slice(-1)!="%"){this.el.setXY(xy);
 }this.focus();this.fireEvent("show",this);},focus:function(){return;if(!this.hidden){this.doFocus.defer(50,this);}},doFocus:function(){if(!this.hidden){this.focusEl.focus();}},hide:function(A){this.hideMenuItems();if(this.el&&this.isVisible()){this.fireEvent("beforehide",this);
 if(this.activeItem){this.activeItem.deactivate();this.activeItem=null;}this.triggerEl.removeClass('open');;this.hidden=true;this.fireEvent("hide",this);}if(A===true&&this.parentMenu){this.parentMenu.hide(true);}},onTriggerClick:function(e){Roo.log('trigger click');