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

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

@ -61,6 +61,11 @@ Makes editable any HTML element on the page. Applied as jQuery method.
//add 'editable' class to every editable element
this.$element.addClass('editable');
//specifically for "textarea" add class .editable-pre-wrapped to keep linebreaks
if(this.input.type === 'textarea') {
this.$element.addClass('editable-pre-wrapped');
}
//attach handler activating editable. In disabled mode it just prevent default action (useful for links)
if(this.options.toggle !== 'manual') {
this.$element.addClass('editable-click');