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() {
|
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() {
|
||||||
|
|
Loading…
Reference in a new issue