From 35c63f59d3882b2f1eaf5d33aee06cc846daa352 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 4 Apr 2014 07:21:20 -0400 Subject: [PATCH] chore(dom) rm unused vars --- lib/client/dom.js | 93 +++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 8336d273..11681c2c 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -270,7 +270,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; * check SVG SMIL animation support */ this.isSVG = function() { - var rect, ret, svgNode, name, + var ret, svgNode, name, create = document.createElementNS, SVG_URL = 'http://www.w3.org/2000/svg'; @@ -301,8 +301,52 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; EventsProto = function() { var Events = this, ADD = true, - REMOVE = false; + REMOVE = false, + process = function(pAdd, pType, pListener, pElement, pUseCapture) { + var i, n, + lElement = (pElement || window), + lEventProcess = pAdd ? + lElement.addEventListener : + lElement.removeEventListener, + + lRet = pType && lEventProcess, + lEvent = ''; + + lEventProcess = lEventProcess.bind(lElement); + + if (lRet) { + if (Util.isString(pType)) + lEventProcess( + pType, + pListener, + pUseCapture + ); + else if (Util.isArray(pType)) + for (i = 0, n = pType.length; i < n; i++) + process( + pAdd, + pType[i], + pListener, + pElement, + pUseCapture + ); + else if (Util.isObject(pType)) { + if (pListener) + pElement = pListener; + + for (lEvent in pType) + process( + pAdd, + lEvent, + pType[lEvent], + pElement, + pUseCapture + ); + } + } + }; + /** * safe add event listener * @@ -505,51 +549,6 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; return lRet; }; - - function process(pAdd, pType, pListener, pElement, pUseCapture) { - var i, n, - lElement = (pElement || window), - - lEventProcess = pAdd ? - lElement.addEventListener : - lElement.removeEventListener, - - lRet = pType && lEventProcess, - lEvent = ''; - - lEventProcess = lEventProcess.bind(lElement); - - if (lRet) { - if (Util.isString(pType)) - lEventProcess( - pType, - pListener, - pUseCapture - ); - else if (Util.isArray(pType)) - for (i = 0, n = pType.length; i < n; i++) - process( - pAdd, - pType[i], - pListener, - pElement, - pUseCapture - ); - else if (Util.isObject(pType)) { - if (pListener) - pElement = pListener; - - for(lEvent in pType) - process( - pAdd, - lEvent, - pType[lEvent], - pElement, - pUseCapture - ); - } - } - } }, CmdProto = function() {