textarea: use white-space: pre-wrap instead of converting nl2br and back, see #48

This commit is contained in:
vitalets
2013-08-05 23:57:30 +04:00
parent 7abe1bff71
commit 081135a221
4 changed files with 43 additions and 5 deletions

View File

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