1
0
Fork 0
forked from 0x2620/oxjs

very basic textarea support

This commit is contained in:
Rolux 2010-02-26 14:22:27 +01:00
commit 94a4ff135d
4 changed files with 30 additions and 5 deletions

View file

@ -1799,7 +1799,7 @@ requires
self.options.type == "textarea" ? "textarea" : "input", self
)
.attr({
type: self.options.type == "textarea" ? null : self.options.type
type: self.options.type == "textarea" ? undefined : self.options.type // fixme: make conditional?
})
.addClass(
"OxInput Ox" + Ox.toTitleCase(self.options.size) +
@ -1989,9 +1989,17 @@ requires
that.triggerEvent("submit", that.$input.val());
}
that.height = function(value) {
if (self.options.type == "textarea") {
that.$element.height(value);
that.$input.height(value);
}
return that;
}
that.width = function(value) {
that.$element.width(value);
that.$input.width(value - 2 -
that.$input.width(value - (self.options.type == "textarea" ? 0 : 2) -
(self.options.labelWidth ? self.options.labelWidth + 34 : 0) -
(self.options.placeholder.length > 1 ? 26 : 0) -
(self.options.clear ? 15 : 0));