From 762606a2697be40f3a977c3e86d492e03f50551e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 21 Oct 2013 10:21:12 +0000 Subject: [PATCH] feature(dom) addOneTime -> addOnce --- lib/client.js | 2 +- lib/client/dom.js | 2 +- lib/client/listeners.js | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/client.js b/lib/client.js index 76c94959..412fa576 100644 --- a/lib/client.js +++ b/lib/client.js @@ -505,5 +505,5 @@ var Util, DOM, CloudFunc, CloudCmd; return Util.stringifyJSON(lFileTable); } - DOM.Events.addOneTime('load', CloudCmd.init); + DOM.Events.addOnce('load', CloudCmd.init); })(Util, DOM); diff --git a/lib/client/dom.js b/lib/client/dom.js index eed2f535..42c3f88b 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -343,7 +343,7 @@ var CloudCmd, Util, DOM, CloudFunc; * @param pUseCapture * @param pElement {document by default} */ - this.addOneTime = function(pType, pListener, pElement, pUseCapture) { + this.addOnce = function(pType, pListener, pElement, pUseCapture) { var lRet = this, lOneTime = function (pEvent) { lRet.remove(pType, lOneTime, pElement, pUseCapture); diff --git a/lib/client/listeners.js b/lib/client/listeners.js index a509ec0e..c624a10d 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -16,7 +16,7 @@ var Util, DOM, CloudCmd; online = config.online; if (analytics && online) { - Events.addOneTime('mousemove', function(){ + Events.addOnce('mousemove', function(){ var FIVE_SECONDS = 5000, lUrl = CloudCmd.LIBDIRCLIENT + 'analytics.js'; @@ -60,7 +60,7 @@ var Util, DOM, CloudCmd; lKeysPanel[lButton] = lEl; if (i === 1 || i === 3 || i === 4 || i === 9) - Events.addOneTime('click', lFuncs[i], lEl); + Events.addOnce('click', lFuncs[i], lEl); else Events.addClick(lFuncs[i], lEl); } @@ -68,7 +68,7 @@ var Util, DOM, CloudCmd; lButton = '~', lEl = DOM.getById('~'); lKeysPanel[lButton] = lEl; - Events.addOneTime('click', CloudCmd.Console, lEl); + Events.addOnce('click', CloudCmd.Console, lEl); return lKeysPanel; }; @@ -301,7 +301,7 @@ var Util, DOM, CloudCmd; }); if (navigator.onLine) - Events.addOneTime('offline', cssSet); + Events.addOnce('offline', cssSet); else cssSet(); }