diff --git a/lib/client/listeners.js b/lib/client/listeners.js index 674fd106..7d2f5005 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -188,11 +188,11 @@ var Util, DOM, CloudCmd; 'click' : DOM.preventDefault, }; - Util.copyObj({ + Util.copyObj(events, { 'mousedown' : setCurrentFile, 'contextmenu' : onContextMenu, 'dragstart' : onDragStart - }, events); + }); Events.add(events, current); diff --git a/lib/client/view.js b/lib/client/view.js index f3d034fc..14d9d85f 100644 --- a/lib/client/view.js +++ b/lib/client/view.js @@ -86,7 +86,7 @@ var CloudCmd, Util, DOM, CloudFunc, $; Config.afterShow = lFunc; - Util.copyObj(Config, config); + Util.copyObj(config, Config); for (name in pConfig) config[name] = pConfig[name]; diff --git a/lib/util.js b/lib/util.js index a47cd5a1..12cde37d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -197,15 +197,16 @@ }; /** - * Copy properties array pProps from pFromObj to pToObj + * Copy properties from from to to * - * @param pFromObj - * @param pToObj - * @param pProps + * @param from + * @param to */ - this.copyObj = function(from, to) { - if (!to) - to = {}; + this.copyObj = function(to, from) { + if (!from) { + from = to; + to = {}; + } Util.forIn(from, function(name) { to[name] = from[name];