add placeholder option to Ox.Editable

This commit is contained in:
rlx 2011-11-03 16:53:29 +00:00
parent 4620461c86
commit 1db28c6fb0

View file

@ -180,9 +180,13 @@ Ox.Editable = function(options, self) {
}
function formatValue() {
return self.options.format
? self.options.format(self.options.value)
: self.options.value
var value = self.options.value;
if (self.options.value === '' && self.options.placeholder) {
value = self.options.placeholder;
} else if (self.options.format) {
value = self.options.format(self.options.value)
}
return value;
}
function submit() {