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() { function formatValue() {
return self.options.format var value = self.options.value;
? self.options.format(self.options.value) if (self.options.value === '' && self.options.placeholder) {
: self.options.value value = self.options.placeholder;
} else if (self.options.format) {
value = self.options.format(self.options.value)
}
return value;
} }
function submit() { function submit() {