PDA

View Full Version : YAHOO.ext.Element.get missing parameters in .40



vtswingkid
11 Jan 2007, 9:21 AM
I pulled the latest from svn trunk 1/11/2007.
YAHOO.ext.Element.get = function()... No parameters.
Is this intentional?

jon.whitcraft
11 Jan 2007, 1:24 PM
if you look at the function you will see that it has this linke in it.


return function(el){

which exposes a parameter for the code. i think the reason he did this was to make these private variables


var doc = document; // prevent IE dom lookup on every call to getEl
var docEl;
var E = YAHOO.ext.Element;
var D = YAHOO.util.Dom;

but only Jack can answer that for sure.

just my two cents.

Animal
12 Jan 2007, 12:25 AM
I pulled the latest from svn trunk 1/11/2007.
YAHOO.ext.Element.get = function()... No parameters.
Is this intentional?

Yes. If you continue to read the source it's



YAHOO.ext.Element.get = function()
{
...
}();


ie, YAHOO.ext.Element.get is set to the the result of the immediate call of the anonymous, parameterless function. And that result is a function which performs the getEl functionality with some private variables closured into it.

jack.slocum
12 Jan 2007, 5:39 AM
I made a couple changes to getEl yesterday that improved performance over 50%. :D

jon.whitcraft
12 Jan 2007, 8:31 AM
I made a couple changes to getEl yesterday that improved performance over 50%. :D

ooo performance increase... *drool*