PDA

View Full Version : [FIXED]ScriptTagProxy Ext.fly instead of Ext.get ?



dolittle
13 Mar 2011, 12:52 PM
In ScriptTagProxy Ext.get is used to remove the script tag after success/failure.
Maybe it should be replaced with Ext.fly to save resources?
Ext.get(request.scriptId).remove();

The function name "createTimeoutHandler" is not accurate because this is the timeout handler,
it doesn't return one.
"createRequestCallback" is also the request callback and doesn't create a callback and return it.
So I suggest "timeoutHandler" and "sucessHandler" instead. It will also save few characters.

evant
13 Mar 2011, 3:21 PM
1) Probably doesn't make much difference, but fly is probably slightly better.
2) Agreed, createTimeoutHandler doesn't create anything.
3) Disagree, the createRequestCallback returns a function, so the name is correct.

Also removed the getHead method from STP, it's included elsewhere.

dolittle
13 Mar 2011, 3:31 PM
Wouldn't it be easier if timeHandler and requestCallback will act in the same way?
Why do you want to have a callback for the timer but create a function dynamically for the request?

It will be much simpler if createRequestCallback will be requestCallback that calls the user defined callback. No need to return a function and do complex stuff.