diff options
| author | amy <[email protected]> | 2023-02-23 15:20:17 +0000 |
|---|---|---|
| committer | amy <[email protected]> | 2023-02-23 15:20:17 +0000 |
| commit | 0cb10535ba89c8fcd9a9d49444a9a9bea8d0f5e2 (patch) | |
| tree | f5ee2f2b254604fe6bfeae257b66ea9bbb64d9c1 /src/common.js | |
| parent | 74f7453b15052f1128e2d9a348aacffb7858cc05 (diff) | |
swapped old scrollbars
Diffstat (limited to 'src/common.js')
| -rw-r--r-- | src/common.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/common.js b/src/common.js new file mode 100644 index 0000000..5606706 --- /dev/null +++ b/src/common.js @@ -0,0 +1,22 @@ +Object.prototype.clone = Array.prototype.clone = function() //https://stackoverflow.com/questions/12690107/clone-object-without-reference-javascript +{ + if (Object.prototype.toString.call(this) === '[object Array]') + { + var clone = []; + for (var i=0; i<this.length; i++) + clone[i] = this[i].clone(); + + return clone; + } + else if (typeof(this)=="object") + { + var clone = {}; + for (var prop in this) + if (this.hasOwnProperty(prop)) + clone[prop] = this[prop].clone(); + + return clone; + } + else + return this; +}
\ No newline at end of file |
