From 0aa4c42ecf6025e92c2a0ef054b40b0e491f970e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 25 Feb 2013 21:11:39 +0000 Subject: [PATCH] fix editing empty values --- source/Ox.UI/js/Form/EditableContent.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/Form/EditableContent.js b/source/Ox.UI/js/Form/EditableContent.js index 66c7e03a..b63e2c93 100644 --- a/source/Ox.UI/js/Form/EditableContent.js +++ b/source/Ox.UI/js/Form/EditableContent.js @@ -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);