update EditableContent and CSS
This commit is contained in:
parent
49f7f011e9
commit
c630818553
3 changed files with 7 additions and 11 deletions
|
@ -920,7 +920,7 @@ OxEditableContent
|
|||
-o-user-select: text;
|
||||
-webkit-user-select: text;
|
||||
}
|
||||
.OxEditableContent.OxEditableContentInput {
|
||||
.OxEditableContent.OxEditing {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Reference in a new issue