add placeholder option to Ox.Editable
This commit is contained in:
parent
4620461c86
commit
1db28c6fb0
1 changed files with 7 additions and 3 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue