add val() method to Ox.$
This commit is contained in:
parent
84491f2122
commit
ecba7968c1
1 changed files with 11 additions and 0 deletions
|
@ -146,6 +146,7 @@ Ox.$ = Ox.element = function(val) {
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
// FIXME: should be "one"
|
||||||
bindOnce: function(events) {
|
bindOnce: function(events) {
|
||||||
var that = this;
|
var that = this;
|
||||||
Ox.forEach(Ox.makeObject(arguments), function(callback, event) {
|
Ox.forEach(Ox.makeObject(arguments), function(callback, event) {
|
||||||
|
@ -262,6 +263,16 @@ Ox.$ = Ox.element = function(val) {
|
||||||
this[0]['on' + event] = null;
|
this[0]['on' + event] = null;
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
val: function() {
|
||||||
|
var ret;
|
||||||
|
if (arguments.length == 0) {
|
||||||
|
return this[0].value;
|
||||||
|
} else {
|
||||||
|
this[0].value = arguments[0];
|
||||||
|
ret = this;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
width: function() {
|
width: function() {
|
||||||
return this[0].offsetWidth;
|
return this[0].offsetWidth;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue