fix editing empty values
This commit is contained in:
parent
0957500476
commit
0aa4c42ecf
1 changed files with 6 additions and 1 deletions
|
@ -78,10 +78,15 @@ Ox.EditableContent = function(options, self) {
|
||||||
|
|
||||||
function edit() {
|
function edit() {
|
||||||
if (self.options.editable && !self.editing) {
|
if (self.options.editable && !self.editing) {
|
||||||
|
var value = formatInputValue();
|
||||||
self.$value
|
self.$value
|
||||||
.text(formatInputValue() || ' ')
|
|
||||||
.addClass('OxEditableContentInput')
|
.addClass('OxEditableContentInput')
|
||||||
.attr({contenteditable: true});
|
.attr({contenteditable: true});
|
||||||
|
if (value) {
|
||||||
|
self.$value.text(value);
|
||||||
|
} else {
|
||||||
|
self.$value.html(' ');
|
||||||
|
}
|
||||||
self.editing = true;
|
self.editing = true;
|
||||||
that.gainFocus();
|
that.gainFocus();
|
||||||
setTimeout(updateSelection, 50);
|
setTimeout(updateSelection, 50);
|
||||||
|
|
Loading…
Reference in a new issue