misc. changes

This commit is contained in:
Rolux 2010-02-11 00:12:59 +05:30
parent db45d4d7c4
commit e6df18001e

View file

@ -772,33 +772,42 @@ requires
// private
function wrapjQuery() {
$.each(oxui.jQueryFunctions, function(i, v) {
$.each(oxui.jQueryFunctions, function(i, fn) {
that[v] = function() {
var args = arguments,
length = args.length,
id, ret;
$.each(args, function(i, v) {
id, ret, $element;
$.each(args, function(i, arg) {
// if an ox object was passed
// then pass its $element instead
// so we can do oxObj.jqFn(oxObj)
if (v.ox) {
if (arg.ox) {
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?
// ret = that.$element[v].apply(this, arguments);
if (length == 0) {
ret = that.$element[v]();
ret = $element[fn]();
} else if (length == 1) {
ret = that.$element[v](args[0]);
ret = $element[fn](args[0]);
} else if (length == 2) {
ret = that.$element[v](args[0], args[1]);
ret = $element[fn](args[0], args[1]);
} 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) {
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))
}
// if the $element of an ox object was returned