I've got a javascript file as follows
(function (rpc) {
rpc.loadHomeBanner = rpc_loadHomeBanner;
function rpc_loadHomeBanner(){
// AN is used by Sencha Animator as an Animation variable
rpc.AN ={};
rpc.AN.Controller = {
setConfig: function(configData) {
// update config crap
}
};
var configData = {
// config crap
};
rpc.AN.Controller.setConfig(configData);
}
})(rpc);
Now on the very first load of the page, I call
rpc.loadHomeBanner();
and it fires up just as I need it to.
The problem is that I have a handleOrientationChange
method that needs to update the config from outside the namespace (I don't want to fire the loadHomeBanner method because of overhead).
handleOrientationChange: function(){
// Updating the config for the animation to ensure appropriate width.
var configData = {
// config crap
};
rpc.AN.Controller.setConfig(configData);
}
How can I call rpc.AN.controller.setConfig
from outside the scope of the closure?