misc. changes
This commit is contained in:
parent
95f9149423
commit
846bbbfbc6
|
@ -772,33 +772,42 @@ requires
|
||||||
|
|
||||||
// private
|
// private
|
||||||
function wrapjQuery() {
|
function wrapjQuery() {
|
||||||
$.each(oxui.jQueryFunctions, function(i, v) {
|
$.each(oxui.jQueryFunctions, function(i, fn) {
|
||||||
that[v] = function() {
|
that[v] = function() {
|
||||||
var args = arguments,
|
var args = arguments,
|
||||||
length = args.length,
|
length = args.length,
|
||||||
id, ret;
|
id, ret, $element;
|
||||||
$.each(args, function(i, v) {
|
$.each(args, function(i, arg) {
|
||||||
// if an ox object was passed
|
// if an ox object was passed
|
||||||
// then pass its $element instead
|
// then pass its $element instead
|
||||||
// so we can do oxObj.jqFn(oxObj)
|
// so we can do oxObj.jqFn(oxObj)
|
||||||
if (v.ox) {
|
if (arg.ox) {
|
||||||
args[i] = v.$element;
|
if (fn == "appendTo" && arg.$content) {
|
||||||
|
args[i] = v.$content
|
||||||
|
} else {
|
||||||
|
args[i] = v.$element;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (v == "html" && that.$content) {
|
||||||
|
$element = that.$content;
|
||||||
|
} else {
|
||||||
|
$element = that.$element;
|
||||||
|
}
|
||||||
// why does this not work?
|
// why does this not work?
|
||||||
// ret = that.$element[v].apply(this, arguments);
|
// ret = that.$element[v].apply(this, arguments);
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
ret = that.$element[v]();
|
ret = $element[fn]();
|
||||||
} else if (length == 1) {
|
} else if (length == 1) {
|
||||||
ret = that.$element[v](args[0]);
|
ret = $element[fn](args[0]);
|
||||||
} else if (length == 2) {
|
} else if (length == 2) {
|
||||||
ret = that.$element[v](args[0], args[1]);
|
ret = $element[fn](args[0], args[1]);
|
||||||
} else if (length == 3) {
|
} else if (length == 3) {
|
||||||
ret = that.$element[v](args[0], args[1], args[2]);
|
ret = $element[fn](args[0], args[1], args[2]);
|
||||||
} else if (length == 4) {
|
} else if (length == 4) {
|
||||||
ret = that.$element[v](args[0], args[1], args[2], args[3]);
|
ret = $element[fn](args[0], args[1], args[2], args[3]);
|
||||||
}
|
}
|
||||||
if (v == "data") {
|
if (fn == "data") {
|
||||||
// Ox.print("data ret", ret, $(ret))
|
// Ox.print("data ret", ret, $(ret))
|
||||||
}
|
}
|
||||||
// if the $element of an ox object was returned
|
// if the $element of an ox object was returned
|
||||||
|
|
Loading…
Reference in New Issue
Block a user