Threaded View
-
23 Oct 2012 12:12 AM #1Sencha Premium Member
- Join Date
- Jan 2008
- Location
- Switzerland, Malaysia, Indonesia
- Posts
- 9
- Vote Rating
- 0
[2.1.0-rc2] Function getPageBox in Element.position might throw JavaScript error
[2.1.0-rc2] Function getPageBox in Element.position might throw JavaScript error
We got some errors showing up in our logs that pointed to this piece of code in the src/dom/Element.position.js file:
Now, by looking at this code snippet above, the experienced coder should find out what could cause the "undefined" error. My guess is that someone was overly excited at optimizing code and just put all variables into the var region without checking.Code:getPageBox: function(getRegion) { var me = this, el = me.dom, w = el.offsetWidth, h = el.offsetHeight, xy = me.getXY(), t = xy[1], r = xy[0] + w, b = xy[1] + h, l = xy[0]; if (!el) { return new Ext.util.Region(); } ...
If el is undefined, this code will throw an error in the vars section. It is being checked later on, but it will never reach it anyway since the error would already have been thrown.
Please change the code to show the following in order to fix this:
I hope this will be fixed before the GA release. Thank you.Code:getPageBox: function(getRegion) { var me = this, el = me.dom; if (!el) { return new Ext.util.Region(); } var w = el.offsetWidth, h = el.offsetHeight, xy = me.getXY(), t = xy[1], r = xy[0] + w, b = xy[1] + h, l = xy[0]; ...
You found a bug! We've classified it as
TOUCH-3612
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote