Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// must here
o.moduleClass=mcls;
o.moduleXid=mxid;
o.create(function(){
var f=function(t,m){
if(callback)xui.tryF(callback);
};
//for functions like: UI refresh itself
if(rt)rt.call(rt.target, o);
//add to parent, and trigger RenderTrigger
if(b)o.show(f,p,childId);
else if(!p.isEmpty())o.show(f,p);
});
if(o.host&&o.host['xui.Module']){
delete o.host.$ignoreAutoDestroy;
}
return this;
},
getParent:function(){
_.arr.each(self._nodes,function(o){
xui.Module.$attachModuleInfo(self,o);
//Recursive call
if(o['xui.Module'])o._createInnerModules();
});
// attach destroy to the first UI control
xui.arr.each(self._nodes,function(o){
xui.Module.$attachModuleInfo(self,o);
//Recursive call
if(o['xui.Module'])o._createInnerModules(tid);
});
// attach destroy to the first UI control
var fun = function(m){
if(m["xui.Module"]){
_.each(m._ctrlpool,function(o){
if(o["xui.Module"])fun(o);
else nodes.push(o);
});
}
};
fun(this);
getInstance:function(module, xid){
var m=this;
if(!xid){
if(module['xui.Profile'] && module.moduleClass && module.moduleXid){
xid = module.moduleXid;
module = module.moduleClass;
}else{
xid = module;
module = null;
}
}
if(module){
m=xui.SC.get(module);
if(!m||!m['xui.Module'])return;
}
var c=m._cache;
for(var i in c)
if(_.isFinite(i) ? (xid+"")==i : ('$'+xid)==i)return c[i];
},
destroyAll:function(){
setPopWnd:function(drop){
if(this.isDestroyed())return ;
var profile=this.get(0);
profile.$poplink=drop?drop['xui.Module']?drop.getRoot(true):drop['xui.UI']?drop.get(0):drop:null;
(profile.$poplink.$beforeDestroy=(profile.$poplink.$beforeDestroy||{}))["$poplink_to"]=function(){
delete profile.$poplink;
};
(profile.$beforeDestroy=(profile.$beforeDestroy||{}))["$poplink"]=function(){
if(profile.$poplink){
xui.filter(profile.box.$drop,function(o){
return o!==profile.$poplink;
});
profile.$poplink.boxing().destroy();
profile.$poplink=null;
}
};
},
_cache:function(type, focus){
var fun = function(m){
if(m["xui.Module"]){
xui.arr.each(m._nodes,function(o){
if(o["xui.Module"])fun(o);
else nodes.push(o);
});
}
};
fun(this);
return this.each(function(prf){
var prop=prf.properties, ID='triggerExcelFormulas:';
if(prop.excelCellId){
if(prf.host && prf.host['xui.Module']){
ID=ID+prf.host.xid;
if(refreshAll===false){
if(!xui.resetRun.exists(ID))
if(prf && prf.host)prf.host.triggerExcelFormulas(prf);
}else
xui.resetRun(ID,function(){
if(prf && prf.host)prf.host.triggerExcelFormulas(null);
});
}
}
});
},
var fun = function(m){
if(m["xui.Module"]){
xui.each(m._ctrlpool,function(o){
if(o["xui.Module"])fun(o);
else nodes.push(o);
});
}
};
fun(this);