1
0
Fork 0
forked from 0x2620/oxjs

form elements rewrite, part 3

This commit is contained in:
rlx 2011-12-22 05:52:46 +00:00
commit d80019a17c
8 changed files with 87 additions and 92 deletions

View file

@ -893,15 +893,19 @@ Ox.Input = function(options, self) {
return that;
};
// fixme: deprecate, options are enough
// FIXME: deprecate, options are enough
that.value = function() {
var value = self.$input.hasClass('OxPlaceholder') ? '' : self.$input.val();
if (self.options.type == 'float') {
value = parseFloat(value);
} else if (self.options.type == 'int') {
value = parseInt(value); // cannot have leading zero
if (arguments.length == 0) {
var value = self.$input.hasClass('OxPlaceholder') ? '' : self.$input.val();
if (self.options.type == 'float') {
value = parseFloat(value);
} else if (self.options.type == 'int') {
value = parseInt(value); // cannot have leading zero
}
return value;
} else {
return that.options({value: arguments[0]});
}
return value;
};
return that;
@ -1876,7 +1880,7 @@ Ox.Range_ = function(options, self) {
}, self.options.animate ? animate : 0, function() {
if (self.options.thumbValue) {
$thumb.value(
value: self.options.valueNames
self.options.valueNames
? self.options.valueNames[self.options.value]
: self.options.value
);