From 059e82a01ba3032d9a12df6d0e1b2695028a4ba9 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 25 Jun 2013 17:48:48 +0000 Subject: [PATCH] Change newlines to
in read-only text to preserve multi-line data. --- etemplate/js/et2_widget_textbox.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_textbox.js b/etemplate/js/et2_widget_textbox.js index 32886c7305..42ed7b6e52 100644 --- a/etemplate/js/et2_widget_textbox.js +++ b/etemplate/js/et2_widget_textbox.js @@ -231,8 +231,16 @@ var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM], set_value: function(_value) { this.value = _value; - if(!_value) _value = ""; - this.span.text(_value); + if(!_value) + { + _value = ""; + } + else + { + _value = _value.replace(/\n/g,'
'); + } + // Use html() or the
gets stripped + this.span.html(_value); }, /** * Code for implementing et2_IDetachedDOM