fix editing empty values

This commit is contained in:
j 2013-02-25 21:11:39 +00:00
parent 0957500476
commit 0aa4c42ecf

View file

@ -78,10 +78,15 @@ Ox.EditableContent = function(options, self) {
function edit() {
if (self.options.editable && !self.editing) {
var value = formatInputValue();
self.$value
.text(formatInputValue() || ' ')
.addClass('OxEditableContentInput')
.attr({contenteditable: true});
if (value) {
self.$value.text(value);
} else {
self.$value.html(' ');
}
self.editing = true;
that.gainFocus();
setTimeout(updateSelection, 50);