summaryrefslogtreecommitdiff
path: root/program/js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/common.js')
-rw-r--r--program/js/common.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js
index c66ea7655..70ef4446b 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -490,6 +490,20 @@ function find_in_array()
return -1;
}
+// recursively copy an object
+function rcube_clone_object(obj)
+{
+ var out = {};
+
+ for (var key in obj) {
+ if (obj[key] && typeof obj[key] == 'object')
+ out[key] = clone_object(obj[key]);
+ else
+ out[key] = obj[key];
+ }
+
+ return out;
+}
// make a string URL safe
function urlencode(str)