textarea: use white-space: pre-wrap instead of converting nl2br and back, see #48
This commit is contained in:
@@ -38,8 +38,10 @@ $(function(){
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
value2html: function(value, element) {
|
||||
|
||||
//using `white-space: pre-wrap` solves \n <--> BR conversion very elegant!
|
||||
/*
|
||||
value2html: function(value, element) {
|
||||
var html = '', lines;
|
||||
if(value) {
|
||||
lines = value.split("\n");
|
||||
@@ -50,7 +52,7 @@ $(function(){
|
||||
}
|
||||
$(element).html(html);
|
||||
},
|
||||
|
||||
|
||||
html2value: function(html) {
|
||||
if(!html) {
|
||||
return '';
|
||||
@@ -69,7 +71,7 @@ $(function(){
|
||||
}
|
||||
return lines.join("\n");
|
||||
},
|
||||
|
||||
*/
|
||||
activate: function() {
|
||||
$.fn.editabletypes.text.prototype.activate.call(this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user