minor fixes

This commit is contained in:
rolux 2012-05-31 00:47:57 +02:00
parent 3683bf3d29
commit 54266bd3b2

View file

@ -2,7 +2,7 @@
/*@
Ox.$ <f> Generic HTML element, mimics jQuery
value <*> `window`, `document`, html element, tagname or selector
value <s|h|w|?> tagname, selector, html element, `window`, or `document`
Passing a tagname ('<tagname>') creates an element, passing a selector
('tagname', '.classname' or '#id') selects an element.
(value) -> <o> Element object
@ -34,7 +34,7 @@ Ox.$ = Ox.element = function(value) {
: value[0] == '.' ? document.getElementsByClassName(value.slice(1))[0]
: document.getElementsByTagName(value)[0];
return element ? {
//@ 0 <e> The DOM element itself
//@ 0 <h> The DOM element itself
0: element,
/*@
addClass <f> Adds a class name
@ -252,6 +252,7 @@ Ox.$ = Ox.element = function(value) {
},
/*@
trigger <f> Triggers an event
(event) -> <o> This element
@*/
trigger: function(event) {
var e = document.createEvent('MouseEvents');
@ -268,7 +269,7 @@ Ox.$ = Ox.element = function(value) {
val: function(value) {
var ret;
if (arguments.length == 0) {
return this[0].value;
ret = this[0].value;
} else {
this[0].value = value;
ret = this;