diff --git a/source/Ox.UI/css/Ox.UI.css b/source/Ox.UI/css/Ox.UI.css index eaf41181..91b8cf5e 100644 --- a/source/Ox.UI/css/Ox.UI.css +++ b/source/Ox.UI/css/Ox.UI.css @@ -920,7 +920,7 @@ OxEditableContent -o-user-select: text; -webkit-user-select: text; } -.OxEditableContent.OxEditableContentInput { +.OxEditableContent.OxEditing { white-space: pre; } diff --git a/source/Ox.UI/css/theme.css b/source/Ox.UI/css/theme.css index d9961cd7..f1ae6738 100644 --- a/source/Ox.UI/css/theme.css +++ b/source/Ox.UI/css/theme.css @@ -456,7 +456,7 @@ Forms border-top-color: $bodyBorder; } -.$themeClass .OxEditableContent.OxEditableContentInput:focus { +.$themeClass .OxEditableContent.OxEditing { background-image: -moz-linear-gradient(top, $inputGradient); background-image: -o-linear-gradient(top, $inputGradient); background-image: -webkit-linear-gradient(top, $inputGradient); diff --git a/source/Ox.UI/js/Form/EditableContent.js b/source/Ox.UI/js/Form/EditableContent.js index 7f611fd7..6d94c1da 100644 --- a/source/Ox.UI/js/Form/EditableContent.js +++ b/source/Ox.UI/js/Form/EditableContent.js @@ -4,7 +4,7 @@ Ox.EditableContent = function(options, self) { if (options.tooltip) { self.tooltip = options.tooltip; options.tooltip = function(e) { - return that.hasClass('OxEditableContentInput') ? '' + return that.hasClass('OxEditing') ? '' : Ox.isString(self.tooltip) ? self.tooltip : self.tooltip(e); } @@ -90,11 +90,7 @@ Ox.EditableContent = function(options, self) { } }) .bindEvent({ - doubleclick: edit, - key_escape: function() { - cancel(); - return false; - } + doubleclick: edit }); self.options.value = self.options.value.toString(); @@ -118,7 +114,7 @@ Ox.EditableContent = function(options, self) { if (self.options.editing) { that.loseFocus(); self.options.editing = false; - that.removeClass('OxEditableContentInput') + that.removeClass('OxEditing') .attr({contenteditable: false}) .html(formatValue()); if (self.options.type == 'input') { @@ -132,7 +128,7 @@ Ox.EditableContent = function(options, self) { if (self.options.editable && !self.options.editing) { var value = formatInputValue(); that.$tooltip && that.$tooltip.remove(); - that.addClass('OxEditableContentInput') + that.addClass('OxEditing') .removeClass('OxPlaceholder') .attr({contenteditable: true}); if (value) { @@ -193,7 +189,7 @@ Ox.EditableContent = function(options, self) { that.loseFocus(); self.options.editing = false; self.options.value = parseValue(); - that.removeClass('OxEditableContentInput') + that.removeClass('OxEditing') .attr({contenteditable: false}) .html(formatValue()); if (self.options.type == 'input') {