forked from 0x2620/oxjs
url controller updates, list bugfixes
This commit is contained in:
parent
ef9040ba24
commit
3965eed153
12 changed files with 98 additions and 48 deletions
10
source/Ox.js
10
source/Ox.js
|
|
@ -431,6 +431,8 @@ Ox.clone <f> Returns a (shallow or deep) copy of an object or array
|
|||
'val'
|
||||
> (function() { a = {key: 'val'}; b = Ox.clone(a); a.key = null; return b.key; }())
|
||||
'val'
|
||||
> Ox.clone(0)
|
||||
0
|
||||
@*/
|
||||
|
||||
Ox.clone = function(col, deep) {
|
||||
|
|
@ -442,7 +444,9 @@ Ox.clone = function(col, deep) {
|
|||
? Ox.clone(val, true) : val;
|
||||
});
|
||||
} else {
|
||||
ret = Ox.isArray(col) ? col.slice() : Ox.extend({}, col);
|
||||
ret = Ox.isArray(col) ? col.slice()
|
||||
: Ox.isObject(col) ? Ox.extend({}, col)
|
||||
: col;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
|
@ -670,10 +674,10 @@ Ox.getset = function(obj, args, callback, context) {
|
|||
var obj_ = Ox.clone(obj), ret;
|
||||
if (args.length == 0) {
|
||||
// getset([])
|
||||
ret = obj;
|
||||
ret = obj_;
|
||||
} else if (args.length == 1 && !Ox.isObject(args[0])) {
|
||||
// getset([key])
|
||||
ret = obj[args[0]];
|
||||
ret = Ox.clone(obj[args[0]]);
|
||||
} else {
|
||||
// getset([key, val]) or getset([{key: val, ...}])
|
||||
args = Ox.makeObject(args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue