1
0
Fork 0
forked from 0x2620/oxjs

some improvements for menu and select

This commit is contained in:
Rolux 2010-02-06 13:53:42 +05:30
commit ec1693c2c4
5 changed files with 70 additions and 26 deletions

View file

@ -20,7 +20,8 @@ Ox.getset = function(obj, args, callback, context) {
calls callback(key, val),
returns context
*/
var args = args || {},
var obj_ = obj,
args = args || {},
callback = callback || function() {},
context = context || {},
length = args.length,
@ -36,8 +37,10 @@ Ox.getset = function(obj, args, callback, context) {
// translate (str, val) to ({str: val})
args = Ox.makeObject(args);
obj = $.extend(obj, args);
$.each(args, function(k, v) {
callback(k, v);
$.each(args, function(key, value) {
if (!obj_ || !obj_[key] || obj_[key] !== value) {
callback(key, value);
}
});
ret = context;
}