forked from 0x2620/oxjs
ox.js cleanup and fixes
This commit is contained in:
parent
11d46c4d17
commit
195cff5bfe
2 changed files with 46 additions and 36 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue