handle empty Ox.EditableContent value via CSS

This commit is contained in:
rolux 2013-02-27 09:25:30 +05:30
parent feae953311
commit f1c8fb39a7

View file

@ -53,12 +53,11 @@ Ox.EditableContent = function(options, self) {
cancel();
return false;
}
/*
setTimeout(function() {
Ox.print('TEXT', that.text())
Ox.print('HTML', that.html())
that.css({padding: that.text() ? 0 : '0 2px'});
//Ox.print('TEXT', that.text())
//Ox.print('HTML', that.html())
});
*/
}
}
})
@ -95,7 +94,7 @@ Ox.EditableContent = function(options, self) {
if (value) {
that.text(value);
} else {
that.html(' ');
that.css({padding: '0 2px'}).text('');
}
self.options.editing = true;
that.gainFocus();
@ -149,10 +148,6 @@ Ox.EditableContent = function(options, self) {
that.loseFocus();
self.options.editing = false;
self.options.value = that.text();
if (self.options.value.charCodeAt(0) == 160) {
// remove nbsp
self.options.value = self.options.value.substr(1);
}
that.removeClass('OxEditableContentInput')
.attr({contenteditable: false})
.html(formatValue());