问题
I've following piece of code in my application which is written in Dojo 1.3.1. My task if to migrate this code to Dojo 1.9.3. My questions is that how I can achieve this? I'm a newbie to Dojo so don't know much about migration from old Dojo syntax to new.
dialogWidget._proxyConnects.push(dojo.connect(
newDialog._fadeIn,
"onEnd",
dialogWidget,
"onLoad"
));
EDIT
I would also like to know that what the above piece of code will do actually? If anyone can explain this to me in one or two sentences.
Thanks
回答1:
This part of Dojo migration guide should help you out.
As on what this does -- you're pushing a (Dojo) connect even handler, that would execute an onLoad
method of dialogWidget
after newDialog._fadeIn
fires onEnd
event. What for -- I can't really say, since I don't know the context this one is run in. Also since it accesses private property of dialogWidget
, I wouldn't be surprised that this would break during update.
Hope this helps.
来源:https://stackoverflow.com/questions/23195535/how-to-migrate-dojo-connect-code-from-dojo-1-3-1-to-1-9-3