projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5303620
)
Roo.js
author
Chris
<chris@roojs.com>
Tue, 26 Nov 2013 07:55:22 +0000
(15:55 +0800)
committer
Chris
<chris@roojs.com>
Tue, 26 Nov 2013 07:55:22 +0000
(15:55 +0800)
Roo.js
patch
|
blob
|
history
diff --git
a/Roo.js
b/Roo.js
index
34ffaec
..
1c8a900
100644
(file)
--- a/
Roo.js
+++ b/
Roo.js
@@
-122,12
+122,21
@@
Roo.apply = function(o, c, defaults){
emptyFn : function(){},
/**
- *
+ *
Clone the object
*
*
*/
clone : function(obj){
-
+ if (obj === null || typeof obj !== 'object') {
+ return obj;
+ }
+
+ var temp = obj.constructor(); // give temp the original obj's constructor
+ for (var key in obj) {
+ temp[key] = cloneObject(obj[key]);
+ }
+
+ return temp;
},
/**