feature(util) copyObj: from, to -> to, from

This commit is contained in:
coderaiser 2014-02-07 11:05:58 -05:00
parent 749c861f86
commit 2bac2857e0
3 changed files with 11 additions and 10 deletions

View file

@ -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);

View file

@ -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];

View file

@ -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];