1
0
Fork 0
forked from 0x2620/oxjs

ox.js cleanup and fixes

This commit is contained in:
rlx 2011-08-23 21:31:08 +00:00
commit 195cff5bfe
2 changed files with 46 additions and 36 deletions

View file

@ -17,13 +17,15 @@ Ox.JQueryElement = function($element) {
that.id = Ox.uid();
//@ ox <string> OxJS version
that.ox = Ox.VERSION;
//@ $element <object> The jQuery DOM element
//@ $element <object> The jQuery-wrapped DOM element
that.$element = $element.data({
oxid: that.id
});
// FIXME: the following two lines should make it possible to do
// $('<div>').appendTo($element) ... check if it works, then replace all
//@ 0 <element> The DOM element
that[0] = that.$element[0];
//@ length <number> 1 (for compatibility with jQuery)
that.length = 1;
Ox.UI.elements[that.id] = that;
return that;
@ -35,6 +37,7 @@ Ox.forEach($('<div>'), function(val, key) {
Ox.JQueryElement.prototype[key] = function() {
var args = arguments, id, ret, that = this;
Ox.forEach(args, function(arg, i) {
// FIXME: with the changes above, is this still needed?
// if an ox object was passed
// then pass its $element instead
// so that we can do oxObj.jqFn(oxObj)