mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(util) copyObj: from, to -> to, from
This commit is contained in:
parent
749c861f86
commit
2bac2857e0
3 changed files with 11 additions and 10 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
15
lib/util.js
15
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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue