update EditableContent and CSS

This commit is contained in:
rolux 2013-02-28 10:33:20 +05:30
parent 49f7f011e9
commit c630818553
3 changed files with 7 additions and 11 deletions

View file

@ -920,7 +920,7 @@ OxEditableContent
-o-user-select: text;
-webkit-user-select: text;
}
.OxEditableContent.OxEditableContentInput {
.OxEditableContent.OxEditing {
white-space: pre;
}

View file

@ -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);

View file

@ -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') {