feature(dom) add events.add array

This commit is contained in:
coderaiser 2013-07-11 16:14:08 +00:00
parent 6f9f7c8bf2
commit be2d0f9a81
2 changed files with 13 additions and 2 deletions

View file

@ -108,6 +108,8 @@ getJSONfromFileTable.
* feature(socket) add chdir on cd
* feature(dom) add events.add array
2012.04.22, v0.2.0

View file

@ -455,8 +455,9 @@ var CloudCmd, Util, DOM, CloudFunc;
return lRet;
};
function process(pAdd, pType, pListener, pElement, pUseCapture){
var lElement = (pElement || window),
function process(pAdd, pType, pListener, pElement, pUseCapture){
var i, n,
lElement = (pElement || window),
lEventProcess = pAdd ?
lElement.addEventListener :
@ -477,6 +478,14 @@ var CloudCmd, Util, DOM, CloudFunc;
pListener,
pUseCapture
);
else if (Util.isArray(pType))
for (i = 0, n = pType.length; i < n; i++)
lProcess(
pType[i],
pListener,
pElement,
pUseCapture
);
else if (Util.isObject(pType)){
if (pListener)
pElement = pListener;