summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--itjs/it.js30
1 files changed, 12 insertions, 18 deletions
diff --git a/itjs/it.js b/itjs/it.js
index 1a792f3..89e68a7 100644
--- a/itjs/it.js
+++ b/itjs/it.js
@@ -6,7 +6,6 @@
function CED(txt)
{
var element = document.getElementById('jsdebug');
-
if (element)
element.innerHTML = txt ? txt : "";
}
@@ -17,7 +16,6 @@ function CED(txt)
function ED()
{
var element = document.getElementById('jsdebug');
-
if (element)
{
var text = "";
@@ -141,25 +139,21 @@ function it_get_iframe_document(iframe)
}
/**
- * Clone src value and return dst. If dst is given then src attributes are
- * copied into it, otherwise a new object is created. Also works with scalar
- * values. Performs a deep copy of objects
- * @param src Source object/value to clone
- * @param dst Destination object to copy attributes from src to (optional)
- * @return dst holding copy of src
+ * Copy attributes from src to dst in a recursive manner.
+ * @param dst Destination object which gets attributes
+ * @param src Source object containing attributes
*/
-function it_clone(src, dst)
+function it_set(dst, src)
{
- if (typeof src == "object")
+ if (dst)
{
- if (!dst)
- dst = {};
-
for (var i in src)
- dst[i] = it_clone(src[i]);
+ {
+ if (typeof src[i] == 'object')
+ it_set(dst[i], src[i]);
+ else
+ dst[i] = src[i];
+ }
}
- else
- dst = src;
-
- return dst;
}
+