minor fixes
This commit is contained in:
parent
3683bf3d29
commit
54266bd3b2
1 changed files with 4 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
Ox.$ <f> Generic HTML element, mimics jQuery
|
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
|
Passing a tagname ('<tagname>') creates an element, passing a selector
|
||||||
('tagname', '.classname' or '#id') selects an element.
|
('tagname', '.classname' or '#id') selects an element.
|
||||||
(value) -> <o> Element object
|
(value) -> <o> Element object
|
||||||
|
@ -34,7 +34,7 @@ Ox.$ = Ox.element = function(value) {
|
||||||
: value[0] == '.' ? document.getElementsByClassName(value.slice(1))[0]
|
: value[0] == '.' ? document.getElementsByClassName(value.slice(1))[0]
|
||||||
: document.getElementsByTagName(value)[0];
|
: document.getElementsByTagName(value)[0];
|
||||||
return element ? {
|
return element ? {
|
||||||
//@ 0 <e> The DOM element itself
|
//@ 0 <h> The DOM element itself
|
||||||
0: element,
|
0: element,
|
||||||
/*@
|
/*@
|
||||||
addClass <f> Adds a class name
|
addClass <f> Adds a class name
|
||||||
|
@ -252,6 +252,7 @@ Ox.$ = Ox.element = function(value) {
|
||||||
},
|
},
|
||||||
/*@
|
/*@
|
||||||
trigger <f> Triggers an event
|
trigger <f> Triggers an event
|
||||||
|
(event) -> <o> This element
|
||||||
@*/
|
@*/
|
||||||
trigger: function(event) {
|
trigger: function(event) {
|
||||||
var e = document.createEvent('MouseEvents');
|
var e = document.createEvent('MouseEvents');
|
||||||
|
@ -268,7 +269,7 @@ Ox.$ = Ox.element = function(value) {
|
||||||
val: function(value) {
|
val: function(value) {
|
||||||
var ret;
|
var ret;
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
return this[0].value;
|
ret = this[0].value;
|
||||||
} else {
|
} else {
|
||||||
this[0].value = value;
|
this[0].value = value;
|
||||||
ret = this;
|
ret = this;
|
||||||
|
|
Loading…
Reference in a new issue