- showAt : function(xy, parentMenu, /* private: */_e){\r
- this.parentMenu = parentMenu;\r
- if(!this.el){\r
- this.render();\r
- }\r
- this.el.setXY(xy);\r
- if(this.enableScrolling){\r
- this.constrainScroll(xy[1]);\r
- }\r
- this.el.show();\r
- Ext.menu.Menu.superclass.onShow.call(this);\r
- if(Ext.isIE){\r
- this.layout.doAutoSize();\r
- if(!Ext.isIE8){\r
- this.el.repaint();\r
+ showAt : function(xy, parentMenu){\r
+ if(this.fireEvent('beforeshow', this) !== false){\r
+ this.parentMenu = parentMenu;\r
+ if(!this.el){\r
+ this.render();\r
+ }\r
+ if(this.enableScrolling){\r
+ // set the position so we can figure out the constrain value.\r
+ this.el.setXY(xy);\r
+ //constrain the value, keep the y coordinate the same\r
+ this.constrainScroll(xy[1]);\r
+ xy = [this.el.adjustForConstraints(xy)[0], xy[1]];\r
+ }else{\r
+ //constrain to the viewport.\r
+ xy = this.el.adjustForConstraints(xy);\r